Comments (8)
The "file" type would be a great addition besides the more common types, as we store file links to object images as a property and having a file browser would speed up adding a file link much.
from tiled.
I implemented a basic version of property types here:
https://github.com/MegaJiXiang/tiled
You can specify int,uint,float,string,filepath, or link
Link is the interesting one. If you specify the unique id (new in this version) of an object as the value of a link property, it becomes part of the hierarchy of the parent object. You can then right click objects and select "clone hierarchy" to clone the object and also all of it's children which get new unique ids and relinked to the parent.
It will make more sense if you try it yourself. :)
from tiled.
I would definitely love to see this implemented soon.
from tiled.
+1
Currently trying to infer the type of a property from its value. It's a pain to do this in C++ (or C) and will lead to odd behavior:
- bool values have to be specified as "true"/"false" strings because 0/1 will be interpreted as int
- all integer values will be int even if the underlying data type is float and the value just happens to be an int
I don't think we need to differentiate between int/uint and float/double because there exist viable runtime conversions. A uint can safely be stored to an int and then cast back to uint if needed. Float values can be read as double, if needed, but I don't think any user will ever need to enter a value with double precision, so float will suffice. As for other uses of strings, their use (path, URL, image, etc) should be inferred from the property's name. But even where that is somehow not possible or feasible, it can easily be determined by using regex or string search. Although ... this could make sense with editor support, ie browse file dialog.
I'd propose to stick to the most common, most basic types in the TMX format for denoting a property's type (type-specific editor support notwithstanding):
- bool
- int
- float
- string
Update: I should have read the first post. :)
from tiled.
+1
One simple change would be allow to edit the property in a multiline editor with an extra "..." at the right side of the editor, that would allow lots of scripts possibilities.
from tiled.
One simple change would be allow to edit the property in a multiline editor with an extra "..." at the right side of the editor, that would allow lots of scripts possibilities.
Multi-line editing is independent of supporting more property types than just strings, but it's definitely something I want to support as well! It is covered by issue #205.
from tiled.
that´s great @bjorn !
from tiled.
This feature has been implemented and released with Tiled 0.16. I've opened #1278 regarding the addition of a custom file type, which is not available yet.
Also just recently I've implemented #205, adding a multi-line editor for string properties.
from tiled.
Related Issues (20)
- Idea: To export Objects Only JSON file HOT 2
- Add a Selected Tile Preview to "Shape Fill Tool", just like the "Stamp Brush" has HOT 6
- tmxrasterizer's --hide-layer doesn't work with group layers HOT 1
- Scripting: Access Terrain Properties
- Issues compiling in Windows (newbie) HOT 3
- Automapping stops working when a project's rules.txt is modified during runtime. HOT 3
- "Blob Tileset" points to a broken link HOT 2
- Add map.fileName in tiled.registerMapFormat -> write HOT 2
- Unable to open a tmx file with a space in the filename using AppImage with the shell HOT 2
- Error with `libtiled` in Java 21: `java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException` HOT 1
- Any AI generated plugin? HOT 1
- Tile Animation Editor may not show additional tiles if source image resized
- World Map chunks getting loaded twice. HOT 4
- Scripting: Signal for brush changing
- Layer Blend Mode Property HOT 2
- Switch keyboard shortcuts for "Save As" and "Save All" HOT 3
- Custom Type Search/Filter HOT 2
- Patterned document background option
- AppStream metadata screenshots are missing a caption
- tileset not displaying HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tiled.