Page 2 of 5
Re: adapting a source script to a personnal code
Posted: Fri Jan 23, 2015 11:57 pm
by Allanon
Hi stefff285!
This was an easy one!
Where you display the brush with:
Code: Select all
DisplayBrush(1, 100, 50, { Width = x, Height = y })
You have to add the tags to set the brush handles to the center, like this:
Code: Select all
DisplayBrush(1, 100, 50, { Width = x, Height = y, AnchorX = 0.5, AnchorY = 0.5 })
Have fun!
Re: adapting a source script to a personnal code
Posted: Sat Jan 24, 2015 12:19 pm
by stefff285
\o/ hourra !
thank a lot ! now finaly i have to make brush by layers. i saw something as this on this forum, i go see ^^
many regards to you !
yogib33r
Re: adapting a source script to a personnal code
Posted: Wed Jan 28, 2015 10:27 pm
by stefff285
ok i'm back
so then i did this code
Code: Select all
@DISPLAY {Width = 640, Height = 480, Title = "Slow Lens Effect"}
@BGPIC 1, "hidden-part.png"
@ANIM 1, "sprite-kiokio-vrai.gif", {transparency = $ff0000}
@ANIM 2, "sprite-jayblood-vrai.gif", {transparency = $ff0000}
Function p_mainloop()
PlayAnim(1,320,100)
PlayAnim(2,150,100)
EndFunction
SetInterval(1, p_MainLoop, 1000/50) ; 50fps
Repeat
WaitEvent
Forever
for this result under Win
https://www.dropbox.com/s/01iocqn4exs43wz/anim.exe?dl=0
so then due to the fonction() i hope, so then many questions
- must i do some loops to display sprites ? it seems the animation fails because of the fonction() but perphaps it there any command i forgot as @clearsprite for sprites ? or perhaps can i call the .gif by sprite ?
- the other question is about layers : i have to display by layers so is fliplayers the right solution ?
- how to make an interpolation ? from x1,y1 to x2,y2 ?
many thanx for this wonderfull software
regards
Re: adapting a source script to a personnal code
Posted: Wed Jan 28, 2015 10:35 pm
by stefff285
ok !
@SPRITE and displaysprite done itt !!!
https://www.dropbox.com/s/o1mkd7g0fka3r ... 2.exe?dl=0
ok going to see more tommorow morning
regards
Re: adapting a source script to a personnal code
Posted: Fri Jan 30, 2015 6:10 pm
by stefff285
ok hello all
now i try to move sprite as this code but it doesnt' success
do not know why ?
the the script
Code: Select all
@DISPLAY {Width = 640, Height = 480, Title = "apng"}
@BGPIC 1, "hidden-part.png"
@SPRITE 1, "sprite-kiokio-vrai.gif", {transparency = $ff0000}
@SPRITE 2, "sprite-jayblood-vrai.gif", {transparency = $ff0000}
xa = 0
ya = 0
xb = 640
yb = 480
v = 1
Function p_mainloop()
v = v - 0,5
v2 = Int (v)
xc = (xa + xb) / v2
yc = (ya + yb) / v2
DisplaySprite(1, xc, yc)
DisplaySprite(2,320,240)
EndFunction
SetInterval(1, p_MainLoop, 1000/50) ; 50fps
Repeat
WaitEvent
Forever
allanon ? other pal ?
thanx a lot to help me
regards
Re: adapting a source script to a personnal code
Posted: Sat Jan 31, 2015 8:34 am
by Allanon
Hi steff,
I've not tried your code but from what I see you chould move your sprite with this code:
Code: Select all
speed = 0.5
sprite1x = 0
sprite1y = 0
Function p_mainloop()
; increase x & y, moving along the screen diagonal
sprite1x = sprite1x + speed
sprite1y = sprite1y + speed
DisplaySprite(1, sprite1x, sprite1y)
DisplaySprite(2,320,240)
EndFunction
Re: adapting a source script to a personnal code
Posted: Sat Jan 31, 2015 12:39 pm
by stefff285
thank you so much !
haaaaaaaaaaaaaaaaaaaaaaarg
lovely
it works fine )
thank you dear friend
Re: adapting a source script to a personnal code
Posted: Sat Jan 31, 2015 8:56 pm
by Allanon
np
Re: adapting a source script to a personnal code
Posted: Thu Feb 19, 2015 1:30 am
by stefff285
ok me back !
so then i have now two main screens to script with
- bgpic : not any problem i think with
- one main sprite i know now, allanon, how to display and move
- 7 little crystal's sprites, wich become yellow when the main sprite (the one upper in list) touching one of them
so i have to make translation between mouseX mouseY and the main sprite
but as the main sprite will be after or in front of one of the cristals, does i need to use layers and if yes (i think so) how can i make it ?
i have to look at documentation but if you have any example to give me, it would be so help for me
regards and allanon count on me to gr33ts you on the main scroll text
many regards to you, andreas and all
yogib33r
Re: adapting a source script to a personnal code
Posted: Thu Feb 19, 2015 5:56 pm
by Allanon
Hi stefff285,
I think I haven't got the point... do you need collision detection between the mouse pointer and the sprites/brush/layer?