Go Back   RunUO - Ultima Online Emulation > RunUO > Utility Support > Ultima SDK

Ultima SDK Support for the Ultima SDK.

Reply
 
Thread Tools Display Modes
Old 07-06-2004, 10:59 PM   #1 (permalink)
 
Join Date: Sep 2002
Age: 20
Posts: 960
Send a message via ICQ to Revan Send a message via AIM to Revan Send a message via MSN to Revan
Default 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 :\
__________________
Can YOU RunUO?
Revan is offline   Reply With Quote
Old 07-07-2004, 03:57 AM   #2 (permalink)
 
Join Date: Mar 2003
Location: Near a lava pool
Age: 8
Posts: 1,012
Default

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.
__________________
Oxygen should be regarded as a drug.
Arya is offline   Reply With Quote
Old 07-07-2004, 06:52 AM   #3 (permalink)
 
Join Date: Sep 2002
Age: 20
Posts: 960
Send a message via ICQ to Revan Send a message via AIM to Revan Send a message via MSN to Revan
Default

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
__________________
Can YOU RunUO?
Revan is offline   Reply With Quote
Old 07-07-2004, 07:10 AM   #4 (permalink)
 
Join Date: Mar 2003
Location: Near a lava pool
Age: 8
Posts: 1,012
Default

Oh, look into the Hue class in the dll. It should have an ApplyTo() method that takes an image and hues it.
__________________
Oxygen should be regarded as a drug.
Arya is offline   Reply With Quote
Old 07-07-2004, 07:16 AM   #5 (permalink)
 
Join Date: Sep 2002
Age: 20
Posts: 960
Send a message via ICQ to Revan Send a message via AIM to Revan Send a message via MSN to Revan
Default

Hue only has Equals and ReferenceEquals
__________________
Can YOU RunUO?
Revan is offline   Reply With Quote
Old 07-07-2004, 08:10 AM   #6 (permalink)
 
Join Date: Mar 2003
Location: Near a lava pool
Age: 8
Posts: 1,012
Default

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
__________________
Oxygen should be regarded as a drug.
Arya is offline   Reply With Quote
Old 07-07-2004, 08:16 AM   #7 (permalink)
 
Join Date: Sep 2002
Age: 20
Posts: 960
Send a message via ICQ to Revan Send a message via AIM to Revan Send a message via MSN to Revan
Default

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..
__________________
Can YOU RunUO?
Revan is offline   Reply With Quote
Old 07-07-2004, 08:34 AM   #8 (permalink)
 
Join Date: Mar 2003
Location: Near a lava pool
Age: 8
Posts: 1,012
Default

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 is offline   Reply With Quote
Old 07-07-2004, 01:03 PM   #9 (permalink)
 
Join Date: Sep 2002
Age: 20
Posts: 960
Send a message via ICQ to Revan Send a message via AIM to Revan Send a message via MSN to Revan
Default

Huessss
Still not there.. And I know I didn't do anything wrong
__________________
Can YOU RunUO?
Revan is offline   Reply With Quote
Old 07-07-2004, 01:21 PM   #10 (permalink)
 
Join Date: Mar 2003
Location: Near a lava pool
Age: 8
Posts: 1,012
Default

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

__________________
Oxygen should be regarded as a drug.
Arya is offline   Reply With Quote
Old 07-07-2004, 04:20 PM   #11 (permalink)
 
Join Date: Sep 2002
Age: 20
Posts: 960
Send a message via ICQ to Revan Send a message via AIM to Revan Send a message via MSN to Revan
Default

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
__________________
Can YOU RunUO?
Revan is offline   Reply With Quote
Old 07-07-2004, 04:37 PM   #12 (permalink)
 
Join Date: Mar 2003
Location: Near a lava pool
Age: 8
Posts: 1,012
Default

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 );
__________________
Oxygen should be regarded as a drug.
Arya is offline   Reply With Quote
Old 07-08-2004, 05:17 AM   #13 (permalink)
 
Join Date: Sep 2002
Age: 20
Posts: 960
Send a message via ICQ to Revan Send a message via AIM to Revan Send a message via MSN to Revan
Default

Yeah I realised that when I woke up this morning...
lol how embarassing, again!
Thanks though
__________________
Can YOU RunUO?
Revan is offline   Reply With Quote
Old 07-08-2004, 05:35 AM   #14 (permalink)
 
Join Date: Sep 2002
Age: 20
Posts: 960
Send a message via ICQ to Revan Send a message via AIM to Revan Send a message via MSN to Revan
Default

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..
__________________
Can YOU RunUO?
Revan is offline   Reply With Quote
Old 07-09-2004, 05:59 PM   #15 (permalink)
 
Join Date: Sep 2002
Age: 20
Posts: 960
Send a message via ICQ to Revan Send a message via AIM to Revan Send a message via MSN to Revan
Default

Any chance of finding an example somewhere?
__________________
Can YOU RunUO?
Revan is offline   Reply With Quote
Old 07-09-2004, 07:59 PM   #16 (permalink)
Forum Expert
 
Bradley's Avatar
 
Join Date: Oct 2002
Location: Hummelstown, PA
Age: 29
Posts: 485
Send a message via ICQ to Bradley Send a message via AIM to Bradley Send a message via MSN to Bradley Send a message via Yahoo to Bradley
Default

Quote:
Originally Posted by Revan
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.
__________________
-----------------------
If your response will contribute nothing to this discussion except to insult me, or someone else in this thread, please do not post.
I am refering to specific individuals.
You know who you are.
Bradley is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5