Hello Guest

Author Topic: Floating damage text  (Read 3317 times)

xenonsin

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 1
    • View Profile
Floating damage text
« on: May 17, 2014, 09:37:14 pm »
Hi , I was wondering if 2dtk UI could be used to achieve this affect? Or would it be better to use other UI assets or even the UnityUI for it?


If so, how to achieve this effect? Do you just instantiate a label at the position of the enemy and tween it to float up and disappear after a certain time?

Thanks,

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Floating damage text
« Reply #1 on: May 17, 2014, 09:44:38 pm »
Quote
If so, how to achieve this effect? Do you just instantiate a label at the position of the enemy and tween it to float up and disappear after a certain time?
You can do that, and it will almost certainly work. You could just use normal a tk2d textmesh for that.

If you want more control, you can add a second camera that only sees the 2d text elements, using camera1.WorldToScreenPoint and camera2.ScreenToWorldPoint to position it correctly.