How to get UV Map from TopUI.tex? In other words how to map different portion of texture and apply in pTextureStock->Ob
#1

Hello.

I'd like to take from topUI Mana bar.

From code and various example I can see clearly that:

//rett HP
Rectangle.SetUV(550, 108, 679, 119, fTexWidth, fTexHeight);
//inside recatngle
RectangleFill.SetUV(286, 220, 289, 227, fTexWidth, fTexHeight);

these two vars of type: UIRectUV map HP bar of topUI (second one from the top left).

What I can not understand is, where is the tool to get such informations?

If i want to grab or swap texture with another one, how to map coordinates in here?

Hope that I explained myself.

Best Regards

#2


1 hour ago, Andrein95 said:




Hello.



I'd like to take from topUI Mana bar.



From code and various example I can see clearly that:


//rett HP
Rectangle.SetUV(550, 108, 679, 119, fTexWidth, fTexHeight);
//inside recatngle
RectangleFill.SetUV(286, 220, 289, 227, fTexWidth, fTexHeight);


these two vars of type: UIRectUV map HP bar of topUI (second one from the top left).



What I can not understand is, where is the tool to get such informations?

If i want to grab or swap texture with another one, how to map coordinates in here?



Hope that I explained myself.



Best Regards




I generally use photoshop for that. Using information panel u can see pixels coords, do zoom and put the mouse over the top-left and bottom-right portion of your rectangle

#3

You can just use the ruler in photoshop too. With it you can just drag these guide lines around and figure out all the coordinates. You an just click on the ruler above or on the left of the window and then you can drag these things around. 

nicolas' solution would also work tho, but i just prefer this way and it feels more accurate.2/monthly_2023_05/Screenshot_2912.png.308f00cacb5d8f1c4debfcc4f50a9583.png" />

#4

Thanks for your reply.

For poor pepole without Adobe Photoshop xD I'm using now GIMP and this is what I got:

2

I do not know how to show also x1 and y1 chord of rectangle. 

AS I can see from code: this corresponds perfectly! -> 

Rectangle.SetUV(550, 108

In Photoshop is this information out of the box?

Thanks

#5


1 hour ago, Andrein95 said:




Thanks for your reply.



For poor pepole without Adobe Photoshop xD I'm using now GIMP and this is what I got:



2



I do not know how to show also x1 and y1 chord of rectangle. 



AS I can see from code: this corresponds perfectly! -> 


Rectangle.SetUV(550, 108


In Photoshop is this information out of the box?



Thanks




OMG but the x1 and y1 could be calculated as x0 + Width and y0 + Height as GIMP show Size:

550 + 130 = 680 ; 108 + 11  = 119 and these are x1 and y1.

You guys did this?

#6

/index.php?/profile/20534-veni/&do=hovercard" data-mentionid="20534" href="/index.php?/profile/20534-veni/" rel="">@Veni , /index.php?/profile/14423-nicolasg/&do=hovercard" data-mentionid="14423" href="/index.php?/profile/14423-nicolasg/" rel="">@nicolasg


Rectangle.SetUV(106, 42, 237, 54, TexWidth, TexHeight);


Fill.SetUV(286, 220, 289, 227, TexWidth, TexHeight);


Rectangle.Left = vPopupPos(1) - mpwidth / 2;

       Rectangle.Right = Rectangle.Left + mpwidth;

        Rectangle.Bottom = vPopupPos(2) -31 ;    //less bottom

        Rectangle.Top = rcHUD2.Bottom - 10;


Fill.Left = rcHUD2.Left + 6;

        Fill.Right = Rectangle.Right - 3;

        Fill.Right = Rectangle.Left + ((Fill.Right - Fill.Left) * fMPRatio);

        Fill.Top = Rectangle.Top + 3;

        Fill.Bottom = Rectangle.Top + 5;


Drawing Rectangle: pDraw->AddTexture(Rectangle.Left, Rectangle.Top, Rectangle.Right, Rectangle.Bottom, UIRECTVRectangle.U0, UIRECTVRectangle.V0, UIRECTVRectangle.U1, UIRECTVRectangle.V1, 0xFFFFFFFF, fPopupZ);


Drawing Fill:  pDraw->AddTexture(Fill.Left, Fill.Top, Fill.Right, Fill.Bottom, UIRECTVFill.U0, UIRECTVFill.V0, UIRECTVFill.U1, UIRECTVFill.V1, 0xFFFFFFFF, fPopupZ);


Everything works perfectly, but I do not understand where to put fill color, is taken automatically from .tex with some hidden information?

#7

IF anyone could put a more advanced guide on how to do some UI positions would be appreciated , i also get confused on how to do this. I know with some UI elements you use pixel location but other ones seem hardcoded and i dont understand where the values are pulled from. And i think some have like 4 UV surface too

#8


11 hours ago, Andrein95 said:




/index.php?/profile/20534-veni/&do=hovercard" data-mentionid="20534" href="/index.php?/profile/20534-veni/" rel="">@Veni , /index.php?/profile/14423-nicolasg/&do=hovercard" data-mentionid="14423" href="/index.php?/profile/14423-nicolasg/" rel="">@nicolasg




Rectangle.SetUV(106, 42, 237, 54, TexWidth, TexHeight);


Fill.SetUV(286, 220, 289, 227, TexWidth, TexHeight);


Rectangle.Left = vPopupPos(1) - mpwidth / 2;

       Rectangle.Right = Rectangle.Left + mpwidth;

        Rectangle.Bottom = vPopupPos(2) -31 ;    //less bottom

        Rectangle.Top = rcHUD2.Bottom - 10;


Fill.Left = rcHUD2.Left + 6;

        Fill.Right = Rectangle.Right - 3;

        Fill.Right = Rectangle.Left + ((Fill.Right - Fill.Left) * fMPRatio);

        Fill.Top = Rectangle.Top + 3;

        Fill.Bottom = Rectangle.Top + 5;


Drawing Rectangle: pDraw->AddTexture(Rectangle.Left, Rectangle.Top, Rectangle.Right, Rectangle.Bottom, UIRECTVRectangle.U0, UIRECTVRectangle.V0, UIRECTVRectangle.U1, UIRECTVRectangle.V1, 0xFFFFFFFF, fPopupZ);


Drawing Fill:  pDraw->AddTexture(Fill.Left, Fill.Top, Fill.Right, Fill.Bottom, UIRECTVFill.U0, UIRECTVFill.V0, UIRECTVFill.U1, UIRECTVFill.V1, 0xFFFFFFFF, fPopupZ);




Everything works perfectly, but I do not understand where to put fill color, is taken automatically from .tex with some hidden information?




I don't know what you mean by fill color, I've never worked with solid colors instead of textures, but in customtitle ui you have a solid color rectangle, orange I think, you can use it as a guide...

#9


1 hour ago, nicolasg said:




I don't know what you mean by fill color, I've never worked with solid colors instead of textures, but in customtitle ui you have a solid color rectangle, orange I think, you can use it as a guide...




What I'm trying to do is to fill the rectangle of MP bar with blue color.

Making a copy paste It got fill with red color (of course hp bar color) but cant understand where is defined. What I did is the steps I wrote above.

#10

the hp bar color is defined inside of a .tex file im fairly sure.

and its position in pixel location gets referenced in the code.



Forum Jump:


Users browsing this thread: 2 Guest(s)