good morning,
ok, this is my first, very simple "circle and box animation" built with liongfx
info: the box depends on the running circle and changes his shapes...
[code=thinbasic]'- first animation try with liongfx, 23.juli.2009 by lionheart
uses "liongfx", "console"
liongfx_ScreenRes 320,240,32
liongfx_windowtitle "liongfx: simple circle & box anima"
dim ticktime, img, alpha as double
dim BF as long
dim x,y,dx,dy as integer
ticktime=timer
x=110
y=110
dx=2 '4 too fast
dy=2
Do
if timer-ticktime > (1/60) then
liongfx_ScreenLock
liongfx_Cls
liongfx_Circle x,y,30, &hFFFF00
liongfx_Line x,y, 140,100, 255,45,60, 12, BF
liongfx_ScreenUnLock
x+=dx
y+=dy
if (x>310) or (x<25) then dx=-dx
if (y>210) or (y<25) then dy=-dy
ticktime=timer
endif
loop until liongfx_Inkey = "p"
liongfx_sleep[/code]
push "p" to exit or close the console window, have fun with it
any feedback are welcome.
my edit: have add an zip file with two examples and liongfx dll updated the file in my second post and collect the stuff here for the future !
nice and sunny day, lionheart
ps: one favour: perhaps it's possible for one of the moderator or eros can do it to get a own new column at the board about all my liongfx material? would be nice !
you can't always get what you want, but if you try sometimes you might find, you get what you need
hi all, have included some little modification for circle box animation example
[code=thinbasic]'- first animation try with liongfx, example p2a, 23.juli.2009 by lionheart
uses "liongfx", "console"
liongfx_Screenres 420,340,32
liongfx_windowtitle "liongfx: simple circle & box anima 2p"
dim ticktime, img, alpha as double
dim BF as long
dim x,x1, y,y1, dx,dy,c,d as integer
ticktime=timer
x=110
y=110
x1=140
y1=140
dx=3
dy=3
Do
if timer-ticktime > (1/60) then
liongfx_ScreenLock
liongfx_Cls
liongfx_PAINT x,y, 40, &hFFFF00
liongfx_Circle x,y,30, &hFFFF00
liongfx_PAINT x,y, &hFF8000,&hFFFF00
liongfx_Line x,y, 140,100, 255,45,60, 12, 24
'liongfx_Paint x+x1/2, y+y1/2, 12, 14 ' generates blinking
liongfx_Line x+1, y+1, x1-1, y1-1,rnd(1,255),100,26,4, 13
liongfx_Screenunlock
x+=dx
y+=dy
if (x>405) or (x<25) then dx=-dx
if (y>305) or (y<25) then dy=-dy
ticktime=timer
endif
loop until liongfx_Inkey = "p"
liongfx_sleep[/code]
a) more colours and one little effect
b) second box
c) if you activate this line
[code=thinbasic]liongfx_Paint x+x1/2, y+y1/2, 12, 14 ' generates blinking [/code]
the scene gets a blinking effect: circle and box disappear/appear for randomly
moments
that's all... it took only few minutes to change the scene. my 5 cent for today !
You may notice perhaps one little disadvantage, because I am not sure if the circle are walking smooth, I am working at the moment with my old notebook.
best regards, Lionheart
you can't always get what you want, but if you try sometimes you might find, you get what you need
Bookmarks