[SOLVED] Create a tool tip to inform player about actor

NicolasVlhv

  • Posts: 6
Hey guys !

I'm currently trying to create tooltip to inform players about actor's ability.
Here is the thing, the player open a hero menu, there are icon such as, sword, fireball, ...
And i want the player to know more about theses when he click on the icon. For example, fireball's damage.

It must not be that hard to do, but there is sooo many way to achieve that, that i'm lost, and i don't want to start one way and notice way later that i should have done it other way.

The thing that block me the most, is that the text must be able to change easily, the fireball can deal some damages, but maybe later, it'll do more damages. So i can't just have one image attached to my actor, because i can't have one image per possibility of damages, and per ability. So it must be done with text. But here is the thing, it quickly become a mess when you have to deal with input events AND drawing event.

So, i'v explained my self a lot so you guys know where i'm in my reflexion, i'm waiting forward your experiences and ideas to solve my problem, which is, to summarize : creating a small tool tip with texts and damages when my player press an icon spell.

« Last Edit: July 23, 2018, 04:25:59 am by NicolasVlhv »

stefan

  • *
  • Posts: 2263
Like you said, there is tons of different ways to achieve this, which also means it is hard to come up with "the best way". Imho you should just try whatever comes up first in your mind, and once you come across a problem, see if you can come up with a workaround, or start from scratch with this new info.

Some tips on how I would start is just having a list of each available spell for your character, which holds another list where each item is a variable of a spell. Something like this:
List of spells:
- spell 1 (Fire, 25, 25, Burn)
- spell 2 (Ice, 15, 50, Stun)
- spell 3 (Normal, 10, 10, None)
- etc

Where each spells consist out of the following variables:
Type of spell, damage, required mana, additional effect.

Then create a draw event that can take an item from this list (depending on what icon you click), and show those values on screen (looping through each spell item), and draw it on screen.

NicolasVlhv

  • Posts: 6
That's pretty smart ! I'll keep this idea. Thanks you !

stefan

  • *
  • Posts: 2263
Glad i could help =)