Post Reply 
Transparency Pixel colour for Sprites on HP Prime
05-21-2021, 09:41 PM
Post: #7
RE: Transparency Pixel colour for Sprites on HP Prime
(05-21-2021 07:12 PM)john gustaf stebbins Wrote:  Here is a silly little program I wrote that uses sprites with a transparent background. I use G2 for the sprites by initializing it as a transparent color and then drawing the images on it.

Code:

EXPORT PENDULUMS2()
BEGIN
DIMGROB_P(G1,320,240);
DIMGROB_P(G2,440,25,RGB(255,255,255,255));

// SET UP SPRITES
FOR B FROM 0 TO 19 DO
ARC_P(G2,11+B*22,11,10,
    {#0,RGB(255-B*12,64,B*12)});
ARC_P(G2,14+B*22,14,4,
    {RGB(255-B*12,64,B*12),RGB(MIN(295-B*12,255),104,MIN(B*12,255))});
END;



FOR T FROM 0 TO 1000 STEP .01 DO

RECT_P(G1,RGB(192,192,192));
TEXTOUT_P(T,G1,10,10);

FOR B FROM 0 TO 19 DO
//C:=RGB(255-B*12,64,B*12,64);
//ARC_P(G1,160+150*SIN(T*(1-B/80)),12+B*11,10,{#0,C});
BLIT_P(G1,150+150*SIN(T*(1-B/80)),2+B*11,G2,1+B*22,1,22+B*22,22);
END;

BLIT(G1);

END;



END;

There's nothing silly about that! That's a really good pendulum wave demonstration!

I'll have a good read through it and make sure I understand it. Thanks for sharing that.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Transparency Pixel colour for Sprites on HP Prime - matalog - 05-21-2021 09:41 PM



User(s) browsing this thread: 1 Guest(s)