Of couse nobody's posted them before, I researched and wrote them in response to your original question...
so... you're welcome...
How to programmicly convert rgb(255,255,255) to $FFFF00 ???
-
- Enthusiast
- Posts: 499
- Joined: Wed Sep 17, 2003 9:17 pm
- Location: Southern California
- Contact:
-
- User
- Posts: 41
- Joined: Wed Dec 29, 2004 11:39 am
- Location: Belgium
ManualUntil then, anybody have a way to change the colors of the four corners of a Sprite3D?
mmm... Somehow I know there is a way to perform direct memory-functions on the videocard. Nice one, I will look into itThe 2D sprite used to create the 3D sprite must not be deleted when a 3D sprite use it. A single 2D Sprite can be used by any number of 3D Sprite.

-
- Enthusiast
- Posts: 168
- Joined: Wed Jun 04, 2003 8:44 am
- Location: Switzerland
Hi there
I have recently done something like this, but not what you want, but i want to share anyway after getting so much from the forum.
Here is how i convert RGB to Hex. Suppose your RGB Color is in this format: 255,30,30
Take care
Cecil
I have recently done something like this, but not what you want, but i want to share anyway after getting so much from the forum.
Here is how i convert RGB to Hex. Suppose your RGB Color is in this format: 255,30,30
Code: Select all
Procedure.s Hex1(farb.l) ; To make sure it return 00 not 0
If Hex(farb.l) = Str(0)
Result1 = "00"
Else
Result1 = Hex(farb.l)
EndIf
ProcedureReturn Result1
EndProcedure
HexColor = "#" + Hex1(Val(StringField(RGBColor,1,",")) + Hex1(Val(StringField(RGBColor,2,",")) + Hex1(Val(StringField(RGBColor,3,","))
Take care
Cecil
This above is from Danilo. I looked all in the C:\Program Files\PureBasic\Library SDK and there is nothing concerning Sprite3D.. anybody know where else to look? Im still searching.The newest description of the Sprite3D lib and its structures
should be in the PB Library SDK.
You have to rewrite the code every time the PB lib internals
change.
A more elegant and cross platform method:
Code: Select all
;Convert a 24bit colour value to a Hex string
Procedure.s RGBToHex(Colour.l)
Protected HexString.s = "#"
HexString + RSet(Hex(Red(Colour)), 2, "0")
HexString + RSet(Hex(Green(Colour)), 2, "0")
HexString + RSet(Hex(Blue(Colour)), 2, "0")
ProcedureReturn HexString
EndProcedure