I’m working on a Level and XP bar, and i want to make something “special” to do. And to do that i want to keep a text static when it is scaling or moving, there’s an example:
When i move or scale the image (Parent of the text) it moves, and i don’t want to move. Do you know any solutions? i also have another issue, if you want to know it then message me and i will tell you the issue and if you could help me. Thanks!
There’s an example poorly made (cause i didn’t know what to do) and image that the block (black) from there center is the text, i can’t explain it but i can show you more images about what i want to make:
For me is easier show images, i hope the images help you to understand my issue
EDIT: Also, this is not impossible, Wsly created a game called “Ethan Gamer Minigames” and the game have the same effect that i want to create, i would ask to Wsly how he did it but i dont think he responds me…
I want to the frame that is white for example, the text be black but the empty side is black, so i want to achieve an effect that if a part of the text is over the side of the black frame, it will change to white, if you still dont understand i can screenshot how the game that i said ago looks like
My bad, I completely misunderstood the question. If you want to keep the “0” from moving, there are two solutions I can think of
Put it in a different gui element which doesn’t move or change size
If you know the position the ‘0’ textlabel should stay at, store the textlabel’s element’s AbsoluteSize and AbsolutePosition. e.g,
-- save the position you want to keep the textlabel at
local size = TextLabel.AbsoluteSize
local position = TextLabel.AbsolutePosition
-- do stuff
-- put the textlabel back to it's original position
TextLabel.Size = Udim2.new(0 ,size.X, 0, size.Y)
TextLabel.Position = UDim2.new(0, position.X, 0, position.Y)
For this, I’d say just make two TextLabels, one black text and one white text. Put one underneath the bar that moves, and one on top, but keep them positioned the same.
As the bar moves, it’ll cover one of the TextLabels, and uncover the other.
At the bottom there’s a level/xp bar and where it says lvl. 3, you can see the green part converts a part of the text in white… That’s what i want to achieve, meanwhile the other part of the text is grey. As you can see it’s possible
Wsly fix the players shown in the top place, they doesn’t have their clothes/accessories
You can just change the colors of the xp bar. @TheCarbyneUniverse’s xp bar is a good example. (It also saves you a lot of work.)
Btw I think the alternating text colors look a bit confusing. You should avoid these confusing schemes if possible to make your game look professional.
I want to do the alternating text colors effect cause some people is saying that my xp/level bar is very bad created. I can only change the text parent to the gui, but i parent to the frame to do the effect that i said, Wsly may not be even able to respond (the creator of the game shown) and that’s why i ask you guys
If something is too hard for you, you should stop doing it and find another way. You can use other ways for decorating your xp bar, like make the text follow the xp bar, as @TheCarbyneUniverse suggested. You can also reference other professional games’ xp bars and use some of their ideas in your xp bar.
The game that im working on, is not made to make profits, robux, be famous, etc. I just want have a game that i like and i can play for free. So i currently don’t care if something is hard for me or not, everything is to make something that i like.
The way I achieve this effect is quite simple. There’s two identical copies of the XP bar. One on top with a green background and white text, and one as the background which is the ‘empty’ one. As the player gains experience, the labels on both bars are changed to match. The top bar is then tweened to the size corresponding to the percentage of XP that the bar is representing.
The hardest part is making XP bars that scale well, using GuiObject.SizeConstraint.RelativeYY, and positioning the text in a way where it is not affected by the frames horizontal size. This takes some time to get right but isn’t too difficult.
Edit; Here’s a model containing the actual XP bar from that minigames game. Have fun poking around in it. Minigames_frameExperience.rbxm (5.6 KB)
I just attached the GUI objects from the game to my previous post. That allows you to play around with Gui sizes and see how the text is affected when tweening.
Afterwards, you can use frameExperience.imageBar.imageBarGreen.Size = UDim2.new((CurrentXP/NextXP)*0.98,0,0.73,0)
to tween the green bar to the correct size.
Thanks for helping, well, im a big fan of your games, and it’s incredible that you talked in this post Also cause i just called you lol and thanks for everything.