EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   XML Modification Help & Info (https://www.eq2interface.com/forums/forumdisplay.php?f=22)
-   -   xml "style" qustion (https://www.eq2interface.com/forums/showthread.php?t=6359)

xriscarter 06-25-2006 05:46 PM

xml "style" qustion
 
OK i editted this whole topic to make it easyer to understand, plus to add pictures of the problem...


You can see where I am trying to add in a button, but it is just a black box.




I am using in the "window_elements_generic.dds" to get the image from.




That is where I am pulling the image from....




I think that this is what is giving me the problem, but I do not know what I should type into the style area to fix it. Anyone have any ideas?

xriscarter 06-27-2006 07:06 AM

Sorry but bump....

Well I got all my new buttons coded now, now if i could just get them all to not be a black box.

Savie 06-27-2006 09:35 AM

Is that a default button that has been reskinned?

Im very new to modding myself, and know almost nothing about the image files and editing them. That being said, have you checked the image name to insure you have it spelled correctly? Caps tend to matter for the most part.

Perhaps if you posted the xml and the image, you may get better help on this.

Hope this helps some.

Edit: Also, you may check to see that you've put the image in the right folder, I've done that in the past trying to hurry thru something lol.

xriscarter 06-27-2006 10:13 AM

No that is an all new button that I have made, I did not copy and paste anything.


I did not edit any image file....dds. Yes the image file is correct as you can see in the pics above.

What xml file you think I should upload? There are like 6 that I have made changes to just to get a button to work.


I am using the default image file so I did not have to move anything it just looks up the image file in "ui/default/image"

Savie 06-27-2006 10:18 AM

Any xml file that you are trying to use this image with would work, the smaller, the better though probably, easier to find the code that way.

If you didn't edit an existing image from the default UI, then the problem may be that you're using the "window_elements_generic.dds" since thats the name of a default image files, then again like I said, I'm new to this so that may not even matter.

If you want to upload both of those, I can take a look see if I can find anything that may cause it not to work.

Also.. have you checked the opaquity on that button?

xriscarter 06-27-2006 10:57 AM

3 Attachment(s)
Ok i think that is all that you will need if you need anyother file just let me know....


yeah the opaquity is 1.000

Zonx 06-27-2006 11:10 AM

Takes a bit of getting used to but here's the deal with styles.

In most cases Object.Style only accepts a pointer to a corisponding Style object or can be left blank. So for a Button, it must be a path to an object of type ButtonStyle or it can be left blank. You can't give Object.Style a pointer to an ImageFrame.

Object.RStyleDefault and the RStyle... variations accept pointers to RectangleStyles. Each of the various RStyles corrispond to the various button states and override any enherited from a ButtonStyle reference. So you've got a Default state (button enabled but not pressed), Active state (enabled and pressed), etc.

So you may be asking, what's the diff between a RectangleStyle and a ButtonStyle...

A RectangleStyle defines how a rectangle should be drawn at varying sizes. You give it up to 5 rows and 3 columns of imageStyles and set how those images shrink/stretch and tile to fill the space. They're the universal image filler.

A ButtonStyle uses multiple RectangleStyles along with font settings to define what a button looks like in its various states. When the mouse is over the button, it shows one image frame and text format, when the button is pressed in shows another combination.

One last element to toss into the mix...
ImageFrames are the most basic graphic resource. With them you select a source image file and define the coordinates of an image slice. The thing is that's prety much all an ImageFrame does. There's a reason for this. In some cases you'll want to use the same image slice but have it shrink and stretch differently, or have a different color tint. And that's what ImageStyles are for, applying different behaviors to the same source image ;)

Button
|_ButtonStyle
. |_RectangleStyle
. . |_ImageStyle
. . . |_ImageFrame

xriscarter 06-27-2006 12:12 PM

My imageframe points to the right dds file.....

My object.style points to buttonStyle (basicButton).....and not to an image file.

So my problem here would be the RectangleStyle? I do not have anything in there right now. Or is my problem that the objectStyle is not pointing to the right place......

Code:

/ButtonStyles.basicButton
should it be something like?

/myui.eq2_ButtonStyles.basicButton
/myui.eq2_ButtonStyles.basicButton.object.styles
/myui.ButtonStyles.basicButton
/myui.ButtonStyles.basicButton.object.styles
/ButtonStyles.basicButton
/ButtonStyles.basicButton.object.styles

Loktha 06-27-2006 01:05 PM

Ok, here's what I think your problem is.

First, your using an imageframe to try and define a button. That's not gonna work. This is what's causing the issue. In the screenshot where you're showing the Source and SourceRect, look at the top of the image. It says Object Properties: (ImageFrame)

This kind of object does require you to define the source and sourcerect, or define the rstyledefault. But your not trying to add a frame, your trying to add a button.

So scrap that entirely. On the insert menu, select object, then select button. Go ahead and fill in all your information. You'll notice the button object doesn't offer you the option of supplying the source and sourcerect. That's because there not needed. You've already given that information when you defined the button in the buttonstyles.xml. So all you have to do is define the style.

Style /ButtonStyles.basicButton

That's it. This should fix your problem.

xriscarter 06-27-2006 04:57 PM

Ok I made the new button the same way that you said too. My question how can you make a buttonstyle that does not have a imageframe?


Loktha 06-27-2006 05:20 PM

I just took a look at your buttonstyles.xml again. It looks like you forgot to define the button.

Your missing this code:

<ButtonStyle DisabledTextColor="#404040" MouseOverTextColor="#FFFF00" Name="BasicButton" NormalTextColor="#E0E0E0" NormalTextStyle="/Fonts.FontZapf15" PressSound="click" RStyleDefault="basicButton.basic_button_normal" RStyleMouseOver="basicButton.basic_button_normal" RStyleMouseOverActivated="basicButton.basic_button_normal" RStyleMouseOverSelected="basicButton.basic_button_normal" RStyleSelected="basicButton.basic_button_normal" SelectedTextColor="#FFFF00" />





************INSERT HERE******************************
- <Namespace Name="basicButton">
<RectangleStyle Center="basic_button_normal" CenterShrinkH="true" CenterShrinkV="true" Name="basic_but_normal" />
<RectangleStyle Center="basic_button_pressed" CenterShrinkH="true" CenterShrinkV="true" Name="basic_but_pressed" />
<RectangleStyle Center="basic_button_rollover" CenterShrinkH="true" CenterShrinkV="true" Name="basic_but_rollover" />
<RectangleStyle Center="basic_button_normal" CenterShrinkH="true" CenterShrinkV="true" Color="#808080" Name="basic_but_disabled" />
- <ImageStyle Filter="true" Name="basic_button_normal">
<ImageFrame Name="image" Source="images/window_elements_generic.dds" SourceRect="104,496,116,508" />
</ImageStyle>
- <ImageStyle Filter="true" Name="basic_button_pressed">
<ImageFrame Name="image" Source="images/window_elements_generic.dds" SourceRect="104,496,116,508" />
</ImageStyle>
- <ImageStyle Filter="true" Name="basic_button_rollover">
<ImageFrame Name="image" Source="images/window_elements_generic.dds" SourceRect="104,496,116,508" />
</ImageStyle>
</Namespace>
***********************************************

Then, in the style, you'll want to put /ButtonStyles.BasicButton

Try that out.


All times are GMT -5. The time now is 08:35 PM.

vBulletin® - Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
© MMOUI