Next thing to do is to uncomment line 30: TransparentSpriteColor(sprite_square, #Black).But even with TransparentSpriteColor(#PB_Default, #Black), the sprite does not show any transparency. sprite_square is created with an alpha channel.If event = #PB_Event_CloseWindow : Break 2 : EndIfĭisplayTransparentSprite(sprite_square, ScreenWidth() / 2, ScreenHeight() / 2)įrame_time = ElapsedMilliseconds() + 1000ĭisplaySprite(sprite_mouse, MouseX(), MouseY()) This actually is the only way to make #Black transparent on this sprite (other than drawing on an intermediary transparent image, or changing the blending method). TransparentSpriteColor(sprite_square, #Black) TODO Comment out to see the change. 2/ Assigning a new value to #PB_Default has no effect. TransparentSpriteColor(#PB_Default, #Black) 1/ Default should be black, but it's not. StartDrawing(SpriteOutput(sprite_square)) sprite_square = CreateSprite(#PB_Any, 200, 200) Sprite_square = CreateSprite(#PB_Any, 200, 200, #PB_Sprite_AlphaBlending) #PB_Sprite_AlphaBlending does not seem mandatory unlike what the doc says. MouseLocate(DesktopMouseX(), DesktopMouseY()) Sprite_fps = CreateSprite(#PB_Any, 40, 20) Sprite_mouse = CreateSprite(#PB_Any, 7, 7)īox(0, 0, OutputWidth(), OutputHeight(), #Black)īox(0, 0, OutputWidth() - 2, OutputHeight() - 2, #White) OpenWindowedScreen(WindowID(0), 0, 0, #screen_width, #screen_height) OpenWindow(0, 0, 0, #screen_width, #screen_height, "TITLE", #PB_Window_BorderLess | #PB_Window_ScreenCentered) InitKeyboard() : InitMouse() : InitSprite() Define sprite_mouse.i, sprite_fps.i, sprite_square.iĭefine frame.i, frame$, frame_time.i, event.i
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |