21
What's New / Re: ScriptBasic - Raspberry Pi
« Last post by Support on March 31, 2019, 10:19:03 PM »This shows some of the SDL_gfx graphic primitives.
Code: Script BASIC
- ' SDL_gfx Demo
- IMPORT gfx.bas
- screen = gfx::Window(700, 600, "ScriptBasic GFX Demo - Raspberry Pi")
- gfx::pixelRGBA(screen, 10, 15, 255, 255, 255, 255)
- gfx::lineRGBA(screen, 20, 10, 70, 90, 255, 0, 0, 255)
- gfx::trigonRGBA(screen, 500, 50, 550, 200, 600, 150, 0, 255, 255, 255)
- gfx::filledTrigonRGBA(screen, 200, 200, 300, 50, 400, 200, 0, 0, 255, 255)
- gfx::rectangleRGBA(screen, 10, 300, 100, 380, 0, 255, 0, 255)
- gfx::boxRGBA(screen, 210, 76, 325, 300, 255, 0, 0, 150)
- gfx::ellipseRGBA(screen, 600, 400, 50, 90, 255, 255, 0, 200)
- gfx::filledEllipseRGBA(screen, 600, 400, 25, 150, 0, 255, 0, 255)
- x[0] = 350
- x[1] = 275
- x[2] = 300
- x[3] = 325
- x[4] = 350
- x[5] = 400
- y[0] = 325
- y[1] = 325
- y[2] = 390
- y[3] = 390
- y[4] = 375
- gfx::polygonRGBA(screen, x, y, 6, 255, 255, 255, 155)
- s[0] = 400
- s[1] = 450
- s[2] = 450
- s[3] = 425
- s[4] = 300
- t[0] = 400
- t[1] = 410
- t[2] = 450
- t[3] = 425
- t[4] = 500
- gfx::filledPolygonRGBA(screen, s, t, 5, 255, 0, 255, 155)
- gfx::Update
- WHILE gfx::KeyName(1) <> "+escape"
- WEND
- gfx::Close