Comments (7)
I see that you have added a pull request with some work regarding this, the issue is that I think that a more broad solution is required, as "hitboxes" are really just objects that can be used in other contexts, and also can have properties, a template, a type, opacity, etc.
As such, I have implemented a "TiledObject" class that all of them can inherit from.
@attr.s(auto_attribs=True, kw_only=True)
class TiledObject:
"""
TiledObject object.
See:
https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#object
Args:
:id_ (int): Unique ID of the object. Each object that is placed on a
map gets a unique id. Even if an object was deleted, no object
gets the same ID.
:gid (Optional[int]): Global tiled object ID
:location (OrderedPair): The location of the object in pixels.
:size (Size): The width of the object in pixels
(default: (0, 0)).
:rotation (int): The rotation of the object in degrees clockwise
(default: 0).
:opacity (int): The opacity of the object. (default: 255)
:name (Optional[str]): The name of the object.
:type (Optional[str]): The type of the object.
:properties (Properties): The properties of the TiledObject.
:template Optional[Template]: A reference to a Template object FIXME
"""
id_: int
gid: Optional[int] = None
location: OrderedPair
size: Size = Size(0, 0)
rotation: int = 0
opacity: float = 1
name: Optional[str] = None
type: Optional[str] = None
properties: Optional[Properties] = None
template: Optional[Template] = None
I am going to move in this direction, hopefully it will work out.
from pytiled_parser.
So...where are they stored now?
from pytiled_parser.
I'm confused about the intent here. But we don't seem to be storing the hitboxes anywhere right now, correct?
from pytiled_parser.
from pytiled_parser.
Ok, so the updated PR should do a better job.
from pytiled_parser.
I am currently doing a major re-work of this, as object parsing is done in two places right now and really should be cleaned up and consolidated
from pytiled_parser.
The new v1.0.0 JSON re-write has 100% coverage of all Tiled object types for this.
from pytiled_parser.
Related Issues (20)
- Investigate version typing HOT 2
- Finish support for wang sets HOT 1
- Add support for Transformations in Tilesets HOT 1
- Object templates for tile objects HOT 1
- Automatically convert infinite map data to finite HOT 2
- Fix for one parallax value being set but not the other HOT 1
- Incorrect link HOT 1
- API Docs HOT 1
- Create some examples
- Cross-loading for object templates HOT 2
- Serialization HOT 1
- Tiled 1.8 Support HOT 1
- Tiled 1.9 compatibility HOT 3
- Custom Properties
- Ability to parse map from already loaded files HOT 1
- Animation frame data fails to load for sheet based animations HOT 1
- Expose TileSet parsing more directly HOT 2
- Build out Programming Guide
- Tweak `Optional` types so that type assertions in arcade are not necessary HOT 1
- Missing `py.typed` marker 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 pytiled_parser.