Types Advanced

Blitz3D Forums/Blitz3D Beginners Area/Types Advanced

Zach3D(Posted 2005) [#1]
My question is could you do this.

type red
field r,g,b
end type
type color
field color1.red
end type
color2.color = new color
color2\color1\r = 255
color2\color1\g = 0
color2\color1\b = 0

Does it work? im guessing not but i am curious


Duckstab[o](Posted 2005) [#2]
yes it should but should be

type red
field r,g,b
end type

type color
field color1.red
end type

color2.color = new color
color2\color1= new red
color2\color1\r = 255
color2\color1\g = 0
color2\color1\b = 0


GitTech(Posted 2005) [#3]
EDIT: Mr. Duck was faster :)

Type Red 
Field r,g,b 
End Type 
Type Color 
Field color1.Red 
End Type 
color2.Color = New Color 



color2\color1=New Red



color2\color1\r = 255 
color2\color1\g = 0 
color2\color1\b = 0


Print color2\color1\r
Print color2\color1\g
Print color2\color1\b



Duckstab[o](Posted 2005) [#4]
only by a wisker :)