So I am making a solar system animation, I want that when user hover their mouse over a planet at the xy location (right side of the world in my case) an object in form of image with all the details of the planet spawns, and when mousehover return null, then image will be removed.
P.S: I know I can achieve it with object transparency but it's not efficient, eating memory, so anyone can help?
P.S.S: I also use a code posted by danpost on this game (credit to danpost), i understand that the setLocation determine which xy location that is the center of the world, but so far it spawn my object on top side of the world (I also understand that radius determine how far object will spawn from center, with plus numbers spawn it at top side, negative bottom side), Anyone know if it's possible to spawn the object on left / right / whatever location i determine instead while keeping the circular pattern?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | public class sun extends Actor { int rotational_speed = 1 ; int radius = 400 ; public void act() { //setLocation((getWorld().getWidth()/2), (getWorld().getHeight()/2)); setLocation(( 960 ), ( 540 )); turn(rotational_speed- 90 ); move(radius); turn( 90 ); } } |