Open EliasZ opened 10 years ago
With jaws you just do sprite = new jaws.Sprite({anchor: "center"})
and
jaws.angle = xxx
On 2013-10-06 11:29, EliasZ wrote:
Great library but I am finding difficulties with rotating a sprite around its center. Looking at Sprite its draw() function, this is currently not possible - am I correct?
Example http://www.williammalone.com/briefs/how-to-rotate-html5-canvas-around-center/
— Reply to this email directly or view it on GitHub https://github.com/ippa/jaws/issues/105.
http://jawsjs.com/jawsjs/examples/example5.html <-- different anchors visualized
Yes, but I couldn't get it to do isometric rotation properly due to the limitations the Sprite.draw function has. So I overrode the draw method in setup.
You do have detail-control over the rotation-point with sprite.anchor_x and sprite.anchor_y. But I've never done isometric rotations so I can't comment on that.
On 2013-10-06 14:57, EliasZ wrote:
Yes, but I couldn't get it to do isometric rotation properly due to the limitations the Sprite.draw function has.
— Reply to this email directly or view it on GitHub https://github.com/ippa/jaws/issues/105#issuecomment-25767634.
For now, I will just override the specific draw method. Thanks for the help.
Another question which doesn't really need a new topic: there is this jaws.Text helper system but in all the demos traditional text rendering is used (directly performing textual stuff on jaws.context). Does this have a reason? Should jaws.Text only be used if you want more control?
Text was a late addition to jaws, most of the existing small examples was done by then. It's a free choice if you want to use it or not. Text was a contribution to jaws .. and I've started using it more and more myself :)
Great library but I am finding difficulties with rotating a sprite properly. I used to work with this:
The result is an isometric rotation.
But with JawsJS I find it hard to invoke these methods on the context in that order because the draw function is very limited. What would be a correct approach?