SetColor()<- with a string?

BlitzMax Forums/BlitzMax Beginners Area/SetColor()<- with a string?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Errr... no.
The setcolor command takes an int so you need to give it an int. At the moment you're giving it a string.
I probably wouldn't be able to put any , in it no?


what do you mean by this?
If you have the values in string variables then cast them to int.
Maybe you should add some example code.
SuperStrict
Type ttest
	Field image:timage
	Field r:Int
	Field g:Int
	Field b:Int
	Function Create:ttest(image:TImage , red : Int , green:Int , blue:Int)
		Local temp:ttest = New ttest
		temp.image = image
		temp.r = red
		temp.g = green
		temp.b = blue
		Return temp
	End Function
	Method Draw()
		SetColor (r , g , b)
		DrawImage image , 0 , 0
	End Method
End Type
Graphics 800 , 600
Local image:timage=LoadImage("max.png")
Local mytest:ttest = ttest.Create(image , 255 , 0 , 255)
While Not KeyHit(KEY_ESCAPE)
	Cls
	mytest.Draw
	Flip
Wend