Giter Site home page Giter Site logo

Comments (17)

bjorn avatar bjorn commented on May 5, 2024

This feature was previously requested here: http://sourceforge.net/apps/mantisbt/tiled/view.php?id=23
(closing the issue in the old bug tracker as a duplicate now)

It would indeed be a nice feature!

Example use-case from the old issue: http://www.cocos2d-iphone.org/forum/topic/2338

from tiled.

slycrel avatar slycrel commented on May 5, 2024

Jumping in over here... I did this for my own project in cocos2d and my rotation format was the same as the binary GID format, then compressed, so it looked the same, inside a layer level. It would be fairly straightforward to implement (0..359 degree integer rotation), but I'm not sure how the UI would work. Would the rotation act as a property maybe, or something else?

from tiled.

bjorn avatar bjorn commented on May 5, 2024

@slycrel I'd expect the rotation to be a floating point attribute similar to QGraphicsItem::rotation. When saving it would be stored like:

<object gid="123" rotation="60" />

This is strictly about object rotation (though of course also tile objects), and not about rotation for the tiles on a tile layer. I'm not sure how useful that would be since you can't freely position those tiles either.

For the GUI I'd probably add some handle for rotating the object, similar to the way it works in Inkscape.

from tiled.

slycrel avatar slycrel commented on May 5, 2024

Thanks bjorn. For what I did previously, flipping will cover what I was using rotation for. http://www.cocos2d-iphone.org/forum/topic/16552 Essentially I was rotating tiles in place for terrain edges. Flipping is the same difference really.

I'll have to poke around at the source some and try to get a better grip on how Tiled sees things. I don't think of tiles as objects, more as painted items based on GIDs, probably because of how cocos2d deals with them. And I won't get this done overnight, but it would be a fun project and I'm already partially there, so we'll see what happens. Thanks for the input. =)

from tiled.

bjorn avatar bjorn commented on May 5, 2024

I don't think of tiles as objects either, hence you hear me say "tile objects" when I'm talking about an object that uses a tile to represent itself. :-)

Support for such objects was added to Tiled Qt with version 0.6.0, which isn't very long ago compared to the time that cocos2d-iphone has supported Tiled, hence I wouldn't be surprised if it doesn't support them yet (I haven't checked).

from tiled.

Chicknstu avatar Chicknstu commented on May 5, 2024

Better still, of objects didn't need to be boxes. They could be polygons, made up of a number of points.

Then you'd have a full Box2D level editor in Tiled too, as well as a tilemap editor!

from tiled.

bjorn avatar bjorn commented on May 5, 2024

@Chicknstu Support for polygon objects is already done for the next release, check out the master branch or try a Windows daily build from http://files.mapeditor.org/daily :-)

from tiled.

Aranda avatar Aranda commented on May 5, 2024

@bjorn awesome. Exactly what I was hoping for! As far as I can see this is pretty much removes the need for rotated rectangle objects. Maps perfectly (excuse the unintended pun) to 2D physics systems.

from tiled.

Aranda avatar Aranda commented on May 5, 2024

Not sure if this is worthy of it's own issue thread so I'll just mention it here. When placing new polygons, it's easy to place multiple points at the same location, particularly the first point as it's hard to see that the polygon has been started. Perhaps it could ignore any points that match the previous point.

from tiled.

bjorn avatar bjorn commented on May 5, 2024

@Aranda Nice suggestion! Pushed as commit 058c752. :-)

from tiled.

mrmalee avatar mrmalee commented on May 5, 2024

any updates on this? I'm going to be starting a new game soon and having tile objects that can rotate and flip will be very valuable to me. Right now I need to either create multiple versions of the tile graphic, or set scale and rotation properties. It's not ideal as sometimes I'm not the only person creating levels and people tend to forget these properties exist.

from tiled.

bjorn avatar bjorn commented on May 5, 2024

@mrmalee This issue is about free rotation support for objects. However, it seems you are talking about issue #58 (with the addition of the diagonal flip bit)?

from tiled.

mrmalee avatar mrmalee commented on May 5, 2024

both would be nice. But flipping would benefit my project more than rotation.

from tiled.

gamedevsam avatar gamedevsam commented on May 5, 2024

Isn't this solved by pull 168?

from tiled.

bjorn avatar bjorn commented on May 5, 2024

@crazysam Not really. That pull request does not actually rotate the object at all, it only adds an 'angle' properly that is visualized with an arrow. That's the functionality its author needed, not for the objects to rotate. Personally I think that angle arrow is a rather rare and specialized use-case hence I have not merged it yet.

from tiled.

gamedevsam avatar gamedevsam commented on May 5, 2024

Ohh, that's odd, would it be difficult to rotate the object in the level based in the angle specified in the properties window?

from tiled.

bjorn avatar bjorn commented on May 5, 2024

@crazysam It should be easy for orthogonal maps. For isometric maps the question is how the rotation should be interpreted. If it would work the same way, the rotation could be done on the QGraphicsItem representing the object.

from tiled.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.