adapting a source script to a personnal code

Find quick help here to get you started with Hollywood

Re: adapting a source script to a personnal code

Postby Allanon » Sat Jan 24, 2015 12:57 am

Hi stefff285!
This was an easy one! :D

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!
:D
User avatar
Allanon
 
Posts: 392
Joined: Sun Feb 14, 2010 8:53 pm
Location: Italy

Re: adapting a source script to a personnal code

Postby stefff285 » Sat Jan 24, 2015 1:19 pm

\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
User avatar
stefff285
 
Posts: 221
Joined: Sat Mar 03, 2012 1:59 pm
Location: dijon / france

Re: adapting a source script to a personnal code

Postby stefff285 » Wed Jan 28, 2015 11:27 pm

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
User avatar
stefff285
 
Posts: 221
Joined: Sat Mar 03, 2012 1:59 pm
Location: dijon / france

Re: adapting a source script to a personnal code

Postby stefff285 » Wed Jan 28, 2015 11:35 pm

ok ! @sprite and displaysprite done itt !!!
https://www.dropbox.com/s/o1mkd7g0fka3r ... 2.exe?dl=0
ok going to see more tommorow morning

regards
User avatar
stefff285
 
Posts: 221
Joined: Sat Mar 03, 2012 1:59 pm
Location: dijon / france

Re: adapting a source script to a personnal code

Postby stefff285 » Fri Jan 30, 2015 7:10 pm

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
User avatar
stefff285
 
Posts: 221
Joined: Sat Mar 03, 2012 1:59 pm
Location: dijon / france

Re: adapting a source script to a personnal code

Postby Allanon » Sat Jan 31, 2015 9:34 am

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
User avatar
Allanon
 
Posts: 392
Joined: Sun Feb 14, 2010 8:53 pm
Location: Italy

Re: adapting a source script to a personnal code

Postby stefff285 » Sat Jan 31, 2015 1:39 pm

thank you so much !
haaaaaaaaaaaaaaaaaaaaaaarg :) lovely

it works fine )

thank you dear friend
User avatar
stefff285
 
Posts: 221
Joined: Sat Mar 03, 2012 1:59 pm
Location: dijon / france

Re: adapting a source script to a personnal code

Postby Allanon » Sat Jan 31, 2015 9:56 pm

np :)
User avatar
Allanon
 
Posts: 392
Joined: Sun Feb 14, 2010 8:53 pm
Location: Italy

Re: adapting a source script to a personnal code

Postby stefff285 » Thu Feb 19, 2015 2:30 am

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
User avatar
stefff285
 
Posts: 221
Joined: Sat Mar 03, 2012 1:59 pm
Location: dijon / france

Re: adapting a source script to a personnal code

Postby Allanon » Thu Feb 19, 2015 6:56 pm

Hi stefff285,
I think I haven't got the point... do you need collision detection between the mouse pointer and the sprites/brush/layer?
User avatar
Allanon
 
Posts: 392
Joined: Sun Feb 14, 2010 8:53 pm
Location: Italy

PreviousNext

Return to Newbie questions

Who is online

Users browsing this forum: No registered users and 1 guest

cron