Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - oug

Pages: 1 2 [3]
31
Support / Re: Sprites disappear and act weird when they are rotated
« on: June 08, 2015, 07:37:53 am »
Yeah I was thinking that that might be the best solution.

Do you have an easy way to sort cards that are on top of each other? Can I dynamically add and remove new sorting layers or do you think it is better to just switch position within the sorting layer?

32
Hi guys,

First of all, amazing product, amazing service and a great experience all around. I've made a variety of 2D games with your product and it's been great since the start.

For now I am working on a TCG (a combination of HeartStone and Triple Triad) and I've run into an issue where the sprites of a card disappear when I try to rotate them. The issue is as follows:

I have a card that consists of a number of layered sprites. These sprites are layered through z-index (not through the sorting layers, ill explain why later) and the have a background, borderhighlight, title, flavourtext, some icons etc. Next to this the card has a back and a front (the idea is that I can use the card as a (pseudo) 3D gameobject and rotate them from laying down to laying up without a large hassle.

The card basically looks like this when viewed from 3D perspective:

Side (3D view) (the spacing between the sprites is slightly exaggerated)


Front (2D view)


Back (2D view)


When I rotate this card in the Y-axis a strange behaviour occurs. The front layer (the one with alle the little visuals) behaves in a really strange way. It seems that the sprites don't follow the proper camera rules (or z-index rules). This is what happens when I rotate the card clockwise (over y-axis)

45 degrees clockwise (ignore the green border, this is the same as the blue one!)


135 degrees clockwise


215 degrees clockwise


305 degrees clockwise


Strange thing is that the three back layers (the back of the card, the background of the front of the card and the edge-highlight of the front of the card) act exactly as I want them to. When I move the front layer (with all the little icons) a lot more to the front (like 100-200) it suddenly works (however, the rotation looks really weird because there is now a visible distance between the background of the card and the front layer.

front layer 100-200 to the front and 45 degrees clockwise rotation  (ignore the green border, this is the same as the blue one!)


My question is: how do I fix this? Is even possible? I've also tried to do this when the sprites are all layered based on sorting layers and then it works fine. However, in that case I have the issue that I have to make sure that all the frontside sprites are hidden when the rotation exceeds 180 (and again show them again when the rotation exceeds 360).

Next to this I will have the issue that when there are a lot of cards in the game, I have to put every card on a different sorting layer (or keep switching all the sprites to different values within the same sorting layer).

Can anyone shine a light on this (the rotation issue as well as a more easy approach to this whole issue)?

Thank you all in advance!

OUG

Pages: 1 2 [3]