playMaker

Author Topic: Visual Level up GUI texture that scales accordingly?[SOLVED]  (Read 3274 times)

SlashHabit

  • Playmaker Newbie
  • *
  • Posts: 16
Hello, first I would like to say that Playmaker is one of the best tools I've ever come across and it has helped me come along way with my game.

Onto my problem!

In my game I have a level up system. The XP is stored in a global float and when the player finishes a quest XP is added to the global float value. Easy. BUT how do I actually show the level progress to the player?

I want it to be shown like in World of Warcraft or Diablo etc. A GUI texture bar that grows whenever XP is added.

I've tried to make it with the GUI Draw Texture action and have it grow whenever XP is added but the problem is that it doesn't scale correctly.

I'm puzzled, how do I make a texture react to the max xp level value and scale accordingly?

Thanks in advance.
« Last Edit: July 23, 2014, 02:26:08 PM by jeanfabre »

SlashHabit

  • Playmaker Newbie
  • *
  • Posts: 16
Re: Visual Level up GUI texture that scales accordingly?
« Reply #1 on: July 21, 2014, 05:12:42 PM »
anyone?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Visual Level up GUI texture that scales accordingly?
« Reply #2 on: July 22, 2014, 07:12:56 AM »
Hi,

It's typically the same behavior as health bars, so I would search the forum with this keyword instead.

http://hutonggames.com/playmakerforum/index.php?topic=1362.15

http://hutonggames.com/playmakerforum/index.php?topic=2405.msg10755#msg10755

and more.

 Bye,

 Jean

SlashHabit

  • Playmaker Newbie
  • *
  • Posts: 16
Re: Visual Level up GUI texture that scales accordingly?
« Reply #3 on: July 22, 2014, 04:07:39 PM »
Hi,

It's typically the same behavior as health bars, so I would search the forum with this keyword instead.

http://hutonggames.com/playmakerforum/index.php?topic=1362.15

http://hutonggames.com/playmakerforum/index.php?topic=2405.msg10755#msg10755

and more.

 Bye,

 Jean

Thanks for your answer but I'm sorry those threads didn't help me at all. Health Bars and my Level up system are two completely different problems.

My problem is that each time the character levels up the max xp needed in order for the player to advance to Level 2 is increased by multiplication 1.3 each level. My GUI texture (not game object) doesn't scale correctly, it goes beyond the edge of my screen. I just can't find the correct function for the following. "Set Max level value -> as my gui textures 100% width"

If there is a function that works like that? I would love to hear about it.

Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Visual Level up GUI texture that scales accordingly?
« Reply #4 on: July 23, 2014, 08:53:59 AM »
Hi,

 I don't understand your math here.

what I think you are facing is a simply math cross multiplication actually:

you have your bar that goes from 0 to 100, but your value may go from 0 to 13 or something.

 The math to find that out are simple:

x = value*100/13, x being something between 0 and 13.

I made an action to help you in this ( float remap)

http://hutonggames.com/playmakerforum/index.php?topic=5122.msg24311#msg24311

and you can get it on the Ecosystem as well.

 Bye,

 Jean

SlashHabit

  • Playmaker Newbie
  • *
  • Posts: 16
Re: Visual Level up GUI texture that scales accordingly?
« Reply #5 on: July 23, 2014, 11:23:53 AM »
Hi,

 I don't understand your math here.

what I think you are facing is a simply math cross multiplication actually:

you have your bar that goes from 0 to 100, but your value may go from 0 to 13 or something.

 The math to find that out are simple:

x = value*100/13, x being something between 0 and 13.

I made an action to help you in this ( float remap)

http://hutonggames.com/playmakerforum/index.php?topic=5122.msg24311#msg24311

and you can get it on the Ecosystem as well.

 Bye,

 Jean

Sorry if I expressed myself incorrectly. English is not my first language and sometimes I have problems articulating myself regarding certain issues, like math.

Anyway thank you so much for that .cs script. It was exactly what I was looking for and everything scales properly now.

Thanks again.