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

Online spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4020
    • 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 »
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10839
  • 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