Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for images in code comments in the script editor #1168

Closed
monk-e-boy opened this issue Jul 6, 2020 · 9 comments
Closed

Add support for images in code comments in the script editor #1168

monk-e-boy opened this issue Jul 6, 2020 · 9 comments

Comments

@monk-e-boy
Copy link

A 3D kite design program

Describe the problem or limitation you are having in your project:

I forget how some bits of code work, e.g. winding of opengl triangles, an image would help.

Describe the feature / enhancement and how it helps to overcome the problem or limitation:

Picture is worth 1,000 comments.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:

Screenshot, paste into code. Image is a comment.

If this enhancement will not be used often, can it be worked around with a few lines of script?:

Don't know

Is there a reason why this should be core and not an add-on in the asset library?:

Don't know

@jonbonazza
Copy link

Not a good odea in general. Adding binary to source files will

a) make the file unusable in many text editors and ides
b) make cod diffs in version control brutal.

Just link to an external image.

@bojidar-bg
Copy link

There are some relatively benign ways to incorporate an image into text. For example, it might be a base64 encoded .svg. After this, it could be just a matter of loading and displaying such images (and convincing TextEdit that you can take the space up for an image). Might be doable with a addon and some hacky code, in fact.

@monk-e-boy
Copy link
Author

monk-e-boy commented Jul 6, 2020

Could you just put an img tag in?

var x = 1
# <img src="res://image1.png">
var y = 2

And the editor would just show the image (maybe on hover?)

Pasting an image would save it, then add the tag as above?

@Calinou
Copy link
Member

Calinou commented Jul 7, 2020

@monk-e-boy Godot's editor isn't a WebView. HTML tags won't work 🙂

@Calinou Calinou changed the title Images in code comments Add support for images images in code comments in the script editor Jul 7, 2020
@Calinou Calinou changed the title Add support for images images in code comments in the script editor Add support for images in code comments in the script editor Jul 7, 2020
@monk-e-boy
Copy link
Author

monk-e-boy commented Jul 7, 2020

@monk-e-boy Godot's editor isn't a WebView. HTML tags won't work

What sort of argument is that? It's too tricky to implement?!

Games are visual. Code and comments should incorporate some visual elements.

Animating sprite? Picture of sprite next to code. Looking for code that generates a flower? Look for picture of flower.

https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.ImageInsertion

Have used this and it worked fine.

Sorry, I seem to be banging on about the merits of images, I assumed this was a pretty common idea that has been implemented in many editors before. I should have expressed the idea more clearly as an argument rather than " let's catch up to other editors"

Having an IMG tag that dynamically loads the image would be neat to hook into unit test output. You could see test results next to anticipated results. E.g. maze generation with a particular seed.

@Calinou
Copy link
Member

Calinou commented Jul 7, 2020

@monk-e-boy Displaying images directly in text editors is definitely not a common feature. I don't know of any editor that supports it out of the box. (The same goes in terminal emulators; a few of them support it, but it's seldom used in practice.)

What sort of argument is that? It's too tricky to implement?!

We gauge implementation complexity when evaluating proposals. Complex proposals are less likely to be accepted than simpler ones.

Animating sprite? Picture of sprite next to code. Looking for code that generates a flower? Look for picture of flower.

If your sprite is large, you don't want it to waste 10+ lines on your screen 🙂
Preserving screen real estate is probably more important than displaying images inline at this point.

I can understand displaying images in a tooltip when hovering their path in a preload() statement (for instance). Since we don't have a system for tooltips in the script editor yet, this would have to be implemented from scratch. TextEdit is pending a refactor, so now may not be a good time to implement that just yet.

@Xrayez
Copy link
Contributor

Xrayez commented Jul 8, 2020

I think the most feasible workaround to this is actually being able to follow links in the script editor: #1172.

@me2beats
Copy link

me2beats commented Oct 8, 2020

Picture is worth 1,000 comments.

And what about video?:) No joke
Btw it's worth implementing it as a plugin rather core, but there's no such APIs yet

@Calinou
Copy link
Member

Calinou commented May 1, 2021

Closing due to lack of support (see the above comments).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants