Author Topic: How to doing a transparency clearscreen?  (Read 1984 times)

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3589
    • View Profile
    • Space Fractal
I dont use clearscreen at all for the main drawings of the backgrounds.

But I doing drawing sprites using pngs with alpha, and I drawing them to a offscreen screen (USESCREEN 2). This is for avoid eventuelly seams artifact when scaled down.

This is not a option of course for the backbuffer, but its would been very neat to do that on offscreen screens aswell.

etc doing someting like CLEARSCREEN -2 for no color wipeout? (howover -1 could do that IF used other than screen 0).


I tried using CREATESCREEN in each frame, but is painfully slow....

Code: GLBasic [Select]
        LOCAL frame, animframe, w, h
        USESCREEN 2
        frame=imageGet("Game")
        GETSPRITESIZE frame, w, h
        CREATESCREEN 2, frame, w, h
        animframe=imageGet("tiles")
        USESCREEN 2
        DrawMap(animframe, scr_X, 40, 0, 0, w, h)
 
« Last Edit: 2011-May-04 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10683
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: How to doing a transparency clearscreen?
« Reply #1 on: 2011-May-04 »
Nice idea. So far try:
Code: GLBasic [Select]
USESCREEN 2
SETTRANSPARENCY RGB(0,0,0)
DRAWRECT 0,0,999,999,RGB(0,0,0) // will draw black colour _AND_ transparent alpha