Navigation Menu

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

Script editor/syntax highlighting in properties #1671

Open
xSke opened this issue Aug 1, 2017 · 3 comments
Open

Script editor/syntax highlighting in properties #1671

xSke opened this issue Aug 1, 2017 · 3 comments
Labels
feature It's a feature, not a bug.

Comments

@xSke
Copy link

xSke commented Aug 1, 2017

A lot of the time you'll want to add rudimentary scripting snippets to an object. It would be nice to have some form for script editor in Tiled. This should probably be a different "property type" (like int, float, color, string, etc). Editing one would pop open a lightweight code editor with syntax highlighting. There should be a dropdown somewhere to select a language for highlighting, which would be saved together with the property in the .tmx file.

Forgive my horrible UI mockups:


@ketanhwr
Copy link
Contributor

ketanhwr commented Aug 2, 2017

Hi @xSke! A similar issue has been opened up previously. You can have a look here: #949

@bjorn bjorn added the feature It's a feature, not a bug. label Aug 2, 2017
@bjorn
Copy link
Member

bjorn commented Aug 2, 2017

@ketanhwr Well, this is not about Tiled itself being scriptable, but about adding language-specific syntax highlighting to the text editor.

@xSke Note that you can already write scripts by using the "string" property type and pressing the small "..." button after selecting the property value to open a primitive text editor. The only difference with your feature request is that there is no syntax highlighting.

I think currently language-specific syntax highlighting is outside the scope of Tiled, but a simple highlighter could be added that changes the color of numbers and string literals. For any kind of serious scripting, I would recommend you save your scripts in separate files and use a proper text editor to edit them. You can use the custom "file" property to refer to them from your maps (and of course, there should be a quick way to open them from Tiled then, which was planned but wasn't done yet).

@xSke
Copy link
Author

xSke commented Aug 2, 2017

I'm sure there's some sort of library for simple syntax highlighting (QScintilla, perhaps?).

The point of this would be for small inline scripts that aren't worth moving to a new file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature It's a feature, not a bug.
Projects
None yet
Development

No branches or pull requests

3 participants