Creating floaties through script
Posted: 01 Sep 2013, 01:15
Hello,
I'm working on a Diablo style game to learn Unity (which is coming along nicely if I say so myself
). The only thing I'm actually stuck on is creating my GUI system, so any help would be really appreciated. I'm just very unclear on the proper way to get some of this stuff done (first forays into GUI work in a 3D environment, used to adobe Flex).
Q: How would I go about creating floaties/healthbars through script?
I'm 100% assuming that I would create a Canvas in xaml, dynamically add Textblocks (and whatever I would use for health bars) to it through script, and then simply update their position/text/whatever else. Right now I'm able to create my textblock and add it to the canvas, but I can't figure out how to position it. I have my Vector2D from my camera. How do I assign this to my text block?
I'm looking to do this through script -- not xaml. I'm much more comfortable writing code then learning how to think in terms of storyboard animations and what not (I haven't touched them yet).
Thanks so much!,
Dale Donahue
I'm working on a Diablo style game to learn Unity (which is coming along nicely if I say so myself
Q: How would I go about creating floaties/healthbars through script?
I'm 100% assuming that I would create a Canvas in xaml, dynamically add Textblocks (and whatever I would use for health bars) to it through script, and then simply update their position/text/whatever else. Right now I'm able to create my textblock and add it to the canvas, but I can't figure out how to position it. I have my Vector2D from my camera. How do I assign this to my text block?
I'm looking to do this through script -- not xaml. I'm much more comfortable writing code then learning how to think in terms of storyboard animations and what not (I haven't touched them yet).
Thanks so much!,
Dale Donahue