So I continue to try to deal with the interface elements
With modal Windows is kind of understandable, there are a few ways - either to create an object with all the sprites which are complex modal window, turn it into a picture, create an object and apply PATH, and the completion of show all objects on the ground where they should be. the second way is to animate the PATH each element of the complex structure.
Now I have to queue tooltips. In CSS they are again elementary - there is a block with position relative or absolute and there is another invisible, attached to this unit. When the mouse is over the parent - we make visible tip and may change its coordinates
As I do in WADE.
I created an object with two sprites - one is what I need on the game screen, and the second invisible - the tooltip.
Next i create onMouseIn
this.setSpriteOffset(1,{x:0,y:-60})
this.getSprite(1).setVisible(true)
then onMouseOut
this.setSpriteOffset(1,{x:0,y:0})
this.getSprite(1).setVisible(false)
It work like-tooltips. But this happens without the animation. Not enough easing functions.
how to make tooltip flew up smoothly and also smoothly changing its opacity from 0 to 1 and back
I see that in the PATH there is a custom user-defined fields. But I don't know how to pass the right object?
I might not want to do it inside the object, like the doll, because it can deprive of flexibility - because the tooltip should be something written (level of a building for example)
I can make a tooltip in another layer on the similarity of the modal window.
Well, now it is necessary to consider the position of an object on the screen, because the tip should not fly up if it is the top border of the screen.
How to link a fixed interface layer with a layer of the game which the user can zoom and pan?
So, to sum up - I have two questions:
- how to smoothly animate any parameter in the game?
- how to relate coordinates between the different layers?