Post Reply 
Transparency Pixel colour for Sprites on HP Prime
05-22-2021, 07:17 PM
Post: #12
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;

What is it in your program that determines that the pendula will be on a transparent background? Is it the line DIMGROB_P(G2,440,25,RGB(255,255,255,255)); ? Something to do with RGB(255,255,255,255))? Is it only the fourth 255 in that, and the fact that it is greater than 128? And then that you are only drawing pixels of other colours on that layer?
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-22-2021 07:17 PM



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