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

Draw offset for individual tiles #871

Open
tcoxon opened this issue Jan 23, 2015 · 6 comments

Comments

Projects
None yet
4 participants
@tcoxon
Copy link

commented Jan 23, 2015

In my current project, we have a lot of sprites that we want to be able to place with tile objects in Tiled. Each of these can have a different origin point within the image.

Draw offset is supported as a property of the tileset, whereas, for us, it would be more useful if it was configurable on a per-tile level, as that would allow us to put all these sprites within a single tileset.

I have a workaround I think will work, but it would be nice to be able to do it in Tiled. It would make draw offset more general.

@bjorn bjorn added the feature label Jan 24, 2015

@bjorn

This comment has been minimized.

Copy link
Owner

commented Jan 25, 2015

Thanks to @Ablu for tracking down the following commit which implements part of this functionality:

9b55907

@ElonDev

This comment has been minimized.

Copy link

commented Jan 25, 2015

Here is clean code who get custom property in tileset file : 5a97ea6

Example

<tile id="0">
    <image width="110" height="70" source="tiles/0.png"/>
    <properties>
        <property name="originalX" value="56"/>
        <property name="originalY" value="28"/>
    </properties>
</tile>
@elvisish

This comment has been minimized.

Copy link

commented Feb 6, 2018

Is this possible yet in Tiled?

@bjorn

This comment has been minimized.

Copy link
Owner

commented Feb 7, 2018

@elvisish Nobody has worked to integrate this feature so far.

The commit I linked to in my previous comment implements part of the needed functionality. What is missing is:

  • Allow the offset to be changed in the UI. An obvious choice is to add it to the Properties view when you select a tile. But since this is essentially about setting an origin, some graphical and more intuitive way could be implemented as well (though I currently don't see a good place for this in the UI).

  • If individual tiles could be offset by some amount, this needs to be taken into account when determining which part of a tile layer to render within a certain rectangle of the viewport. You could look into how this is done for the existing tileset-wide tile offset and calculate the per-tile offsets into it.

@bjorn

This comment has been minimized.

Copy link
Owner

commented Jul 28, 2018

@bjorn

This comment has been minimized.

Copy link
Owner

commented Mar 28, 2019

Requested again on the forum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.