RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Hues, Coloring

Revan

Sorceror
Hues, Coloring

Can't beleive I didn't post this here sooner..

How do I color statics?
There is no parameter for it so I couldn't really figure it out :\
 

Arya

Wanderer
Yes there is a parameter for hue. This is from my own code:

Code:
internal struct StaticData
 {
  		public ushort Color;
  		public byte XOffest;
  		public byte YOffset;
  		public sbyte Altitude;
  		public ushort Hue;
  }

I'm not sure if Krrios called the fields as I did, but you shouldn't have a hard time figuring it out. Color means ID (it's used both for the ID of the item and for the color displayed on the radar map). The last 2 bytes are what you're looking for.

Edit: I took a quick look at the Ultima.dll in my object browser. The StaticTile class has five fields: m_X, m_Y, m_Z, m_ID and m_Hue.
 

Revan

Sorceror
I don't think I was clear enough sorry..
I have a form.. Onto that form I draw statics using the GetStatic function
how do I color those? Nothing to do with client :)
 

Arya

Wanderer
Oh, look into the Hue class in the dll. It should have an ApplyTo() method that takes an image and hues it.
 

Arya

Wanderer
Maybe you're using an older version. I'm using build 1.0.1338.1619 and I have the following methods (besides the ones inherited from object):

ApplyTo( Bitmap, bool )
GetColor( int )
Colors, Index, Name properties
2 constructors
 

Revan

Sorceror
oh you meant Hues, not Hue..
Still no ApplyTo there :(
GetColor is there though

How the hell do I get the Ultima SDK from RunUO.com? This is getting frustrating..
 

Arya

Wanderer
Spelling error, I was indeed talking about the Hue class. And if I remember correctly Pandora's Box ships with Ultima.dll, so you can get it from there.
 

Arya

Wanderer
Well, if you're using the library supplied with Pandora's Box, you must be doing something wrong ;)

 

Revan

Sorceror
woah.. It has to do with where I'm writing this line. I just type like "Ultima." and see what i get, then i go to "Ultima.Hue." and see what's there (Inside the paint event) and I do not get that stuff..
So i checked with the object browser and it's right there *blush*
But wouldn't a parameter need to be a hue in order to actually pick something?
ok, an example would really just explain everything tbh
 

Arya

Wanderer
Yep, that's why you weren't seeing it. You need a hue object to call the method. Something like:

Ultima.Hue hue = .... // Get the hue from Ultima.Hues for example
hue.ApplyTo( bmp, false );
 

Revan

Sorceror
ok, I expected some kind of error.. at least its not a compiler error ;)

If the boolean in ApplyTo is set to false the bitmap disappears completely, if it's set to true it either does nothing or makes lots of holes in objects :\
I've tried with different known hues and they really don't want to work for me..
 

Bradley

Sorceror
Revan said:
Any chance of finding an example somewhere?
Code:
Dim TempImage As Bitmap = Ultima.Art.GetStatic(Value)
mHue.ApplyTo(TempImage, False)
Target.DrawImage(TempImage, Me.Location)
TempImage.Dispose()

It's VB, but it should be easy enough to translate.

*EDIT*
mHue is an instance of the Hue Class that you want to use to color the image.
 
Top