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)
- Object reference arrows too prominent
- Unify line breaks HOT 6
- Single letter shortcut keys do not work on builds of macOS 10.14+ or later HOT 2
- Automap Output not Saving in XML HOT 2
- Automap not working anymore HOT 8
- Generate random tiles from a seed HOT 5
- Include the type for custom classes in JSON HOT 4
- unexpected item type 'AutotestRunner'
- Tiled tries to scan the entire home directory, making it freeze HOT 4
- Omit properties from export
- Crash when launching Tiled 1.10.2 installed from the itch.io app (macOS) HOT 4
- Status Bar pixel coord is rounded rather than floored for orthogonal maps HOT 2
- Automapping: Rules with empty input don't affect top and left of map
- polygon vertices HOT 3
- Inconsistencies between .tmx and .tmj files when saving / exporting. HOT 4
- View tileset and tile properties at the same time. HOT 2
- How to get the configuration table (怎么获取配置表) HOT 9
- "Edit Terrain" button in Terrain Sets view
- Setting object.polygon in script makes all points (0,0) HOT 5
- Define own tooltips for custom properties 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.