Made Yesterday this example with Gradient Background freebasic Letter and a Kind of Dog pattern... This Dog pattern doesn't Work correct and I wanted to Center this Dog in my Scene
Help is Welcome
Code: Select all
' - dog pattern with gradient background, 22-04-2024
' - freebasic, example with gradient bg and colored letter
' dog patterns arent correct here
'
ScreenRes 640, 480, 32
Dim As Integer r, g, b
DIM buffer AS ANY PTR
' GRADIENT BACKGROUND -------------------------------------- //
FOR x As Long = 0 TO 639
FOR y As Long = 0 TO 479
r = INT((255 * x) / 640)
g = 0
b = INT((255 * y) / 480)
PSET (x, y), RGB(r, g, b)
NEXT
Next
' TEXT ----------------------------------------------------- //
DIM AS STRING text = "FreeBASIC"
Dim As Integer x = 5
Dim As Integer y = 20 'x = 20, y = 12
FOR i As Long = 1 TO LEN(text)
LOCATE y, x
SELECT CASE i
CASE 1
COLOR RGB(255, 0, 0) ' F
CASE 2
COLOR RGB(0, 255, 0) ' r
CASE 3
COLOR RGB(0, 0, 255) ' e
CASE 4
COLOR RGB(255, 255, 0) ' e
CASE 5
COLOR RGB(255, 0, 255) ' B
CASE 6
COLOR RGB(0, 255, 255) ' A
CASE 7
COLOR RGB(255, 0, 255) ' S
CASE 8
COLOR RGB(255, 255, 255) ' I
CASE 9
COLOR RGB(250, 0, 0) ' C
END SELECT
PRINT MID(text, i, 1);
x = x + 9
Next
Print ""
' DOG SHAPE ------------------------------------------------- //
Locate 30,10
DIM SHARED AS STRING dog(12)
dog(1)=" __\ \ _"
dog(2)=" __ \ \ _"
dog(3)=" / __o o | \\"
dog(4)=" /_\ | |"
dog(5)=" | /"
dog(6)=" /___\"
dog(7)=" | |"
dog(8)=" | | | \\"
dog(9)=" |__|__| \\"
dog(10)=" / \__\\__"
dog(11)=" | ______|"
dog(12)=" |_________|"
x = 200
y = 200
FOR i As Long = 1 TO 12
LOCATE y, x
PRINT dog(i)
y = y + 1
NEXT
buffer = IMAGECREATE(400, 400, 1)
DRAW buffer, dog(12)
PUT (10, 10), buffer
Sleep()