Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func.f_updatePoints = function(amnt)
- -- first make sure that the previous points display is removed --
- if g_gui and g_gui.pointsText then
- if g_gui.pointsText.parent then
- display.remove(g_gui.pointsText);
- end
- g_gui.pointsText = nil;
- end
- data.points = data.points + amnt;
- local points = display.newRetinaText("PTS: "..data.points,265,13,"Lovely Eunike Hans",16);
- points:setReferencePoint(display.TopLeftReferencePoint);
- points.x = 360;
- points.y = 20;
- points.alpha = 0;
- g_gui:insert(points);
- g_gui.pointsText = points;
- -- animate it --
- timer:newTransition(points,{time=300,alpha = 1,y=30,onComplete = function(points)
- timer:newTransition(points, {delay=400,time=300,y=50,alpha = 0,onComplete=function(points)
- if points.parent then
- points.parent.pointsText = nil
- display.remove(points)
- end
- });
- });
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement