OK guys, thanks for claifying things.
I was doing a little bit of experimentation earlier and the following would not compile until I declared my types as global, maybe I'm mistaken but it seems they don't have global scope unless declared explicitly as such. A type is basically a blueprint from which to construct your entities.
// Project: DrawBox Experiment
// Created: 2015-02-10
// set window properties
SetWindowTitle( "DrawBox Experiment" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
global ScreenSize as tScreenBounds
global Gradient as tGradient
//Display some useful info to the user.
Print("Gradient.Top = " + Str(Gradient.Top))
Print("Red = " + Str(GetColorRed(Gradient.Top)))
Print("Green = " + Str(GetColorGreen(Gradient.Top)))
Print("Blue = " + Str(GetColorBlue(Gradient.Top)))
Print("Gradient.Bottom = " + Str(Gradient.Bottom))
Print("Red = " + Str(GetColorRed(Gradient.Bottom)))
Print("Green = " + Str(GetColorGreen(Gradient.Bottom)))
Print("Blue = " + Str(GetColorBlue(Gradient.Bottom)))
//Press the up arrow key to change the gradient.
if(GetRawKeyPressed(38)) = 1 then SetColourGradient()
X1 as float
Y1 as float
X2 as float
Y2 as float
Top as integer
Bottom as integer
ScreenSize.X1 = GetScreenBoundsTop()
ScreenSize.Y1 = GetScreenBoundsLeft()
ScreenSize.X2 = GetScreenBoundsRight()
ScreenSize.Y2 = GetScreenBoundsBottom()
Gradient.Top = MakeColor(Random(0,255),Random(0,255),Random(0,255))
Gradient.Bottom = MakeColor(Random(0,255),Random(0,255),Random(0,255))
What is the relationship, if any, of the string returned from Str(Gradient.Top))
? It doesn't seem to reflect the values of the red, green, and blue components of the colour?
[ Coding In BASIC using AppGameKit V2 ]