Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Intro — Gideros Forum

Intro

misterhupmisterhup Member
edited October 2015 in Game & application design
Ok, so I am trying to make an intro for my game...I just want an image to fade in. How could I do that? I tried with a movieclip but it seems that the table does not save the opacity of the image...just the image.
local x=0.2
 
local frame={}
local img2=Bitmap.new(Texture.new("title.png"))
 
for i = 1,9 do
	--x = 0.1
	print(x)
	img2:setScale(4.5,4.5,0)
	img2:setAlpha(x)
	x = x + 0.1
	--img2:setAnchorPoint(0.5,0.5)
	frame[#frame+1] = img2
end
 
local animatie = MovieClip.new{
{1,5,frame[1]},
{6,10,frame[2]},
{11,15,frame[3]},
{16,20,frame[4]},
{21,25,frame[5]},
{26,30,frame[6]},
{31,35,frame[7]},
{36,40,frame[8]},
{41,45,frame[9]}
}
 
animatie:setGotoAction(45,1)
animatie:gotoAndPlay(1)
animatie:setPosition(0,0)
stage:addChild(animatie)

Comments

  • dreiko65dreiko65 Member
    edited October 2015
    Have you tried to use the Gtween class?

    http://giderosmobile.com/tools/gtween

    Likes: misterhup

    +1 -1 (+1 / -0 )Share on Facebook
  • Thank you so much! I am kinda a noob and didnt tried that. I got it now. Thanks!
  • Tweening is amazing! It allows you to do a bunch of cool effects and you can basically animate your whole game with it. Take time to experiment with the Gtween class, and you will never go back to doing things the hard way :)
  • jdbcjdbc Member
    edited October 2015
    Tweening is amazing! It allows you to do a bunch of cool effects and you can basically animate your whole game with it. Take time to experiment with the Gtween class, and you will never go back to doing things the hard way :)
    MovieClip is native so provides better performance than GTween. I was using GTween but I will replace all with MovieClip.
  • I agree with @jdbc; use MovieClip if you can because it's faster.

    In some edge cases where you need to tween something that isn't a Sprite, such as kinematic bodies in Box2D, you have to use GTween. In most cases you should be able to use MovieClip though.

    My Gideros games: www.totebo.com
  • NinjadoodleNinjadoodle Member
    edited October 2015
    Thanks for the tips guys! its nice to know about the speed difference.

    I use GTween a lot, but usually with only a couple of sprites on screen, for point & click type games :)

    Using Tweening is a really good way to save on Atlas space, especially if your game has lots of graphics/animation. It's awesome when combined with frame by frame animation, for things like rotations, bopping movements, left and right movements etc.

    I understand that using it for action style games, you might notice some performance drawbacks, but for point and click style adventure games and puzzles, I wouldn't go without it.

    As an example, I have an animated slash screen in my games that uses a few images, but the rest is done with Tweening. This splash screen animation, takes up most of the screen, and if I was going to use frame by frame animation, it would be absolutely huge and most likely crash the device it's running on. With tweening tho, I get the animation I want without any hassle and the fps is good too.

Sign In or Register to comment.