Search Unity

Energy Bar Toolkit - 2D and 3D Progress Bars

Discussion in 'Assets and Asset Store' started by genail, Mar 30, 2013.

  1. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello There,

    The change speed is not a time interval, but the percentage change per second. For example if set to 0.5, the bar will fill from 0 to 100% in two seconds (50% per second). I cannot add smooth change option to change bar value or change percent value, because it should be done by setting the effect options.

    Hope it helps!
    Cheers!
    Piotr
     
  2. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello Changchun,

    I'm sorry for that. I've experienced some nasty errors in 2.1.0 for situations where root objects are in different position than 0, 0, 0.
    I've fixed one case, and I will send you the updated version in a moment. Please let me know if it will fix your issue.

    The problem araised when I've changes some fundamentals of rendering code. I needed to do that, because Energy Bar Toolkit 2.0.0 caused Unity to crash in some cases, and prefabbing was a hell ;-)

    Please let me know if the update fixed your problem. If not, please send me screenshots of your case to support@madpixelmachine.com

    Cheers!
    Piotr
     
  3. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Announcement for all EBT users!

    If you're using Energy Bar Toolkit and you don't mind to tell the world about it :)cool:), I want you here: http://energybartoolkit.madpixelmachine.com/games.html !
    If you're interested in putting your game banner on our page, please write to support@madpixelmachine.com. Your game don't need to be finished! We just require a working landing page and a 300x150px baner ;-)
     
  4. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Energy Bar Toolkit 2.1.1 (bug fix release for 2.1.x line) is out!

    Improvements
    - Corrected script execution order to make mesh bars rendering more stable
    - Smoother movement of bars (changed script execution priority)
    - NGUI: Smoother movement of bars
    - Look At Camera moved from anchors to Position Size section of any bar

    Bug Fixes
    - Anchors for Mesh bars was broken when anchoring to objects on newly created scenes
    - Text tinting was broken (not reacting to color change)
    - NGUI: Fixed warnings in integration code about inconsistent line endings
    - NGUI, DF-GUI: Mesh Transform were reporting wrong size right after creation causing it to scale to very small size
    - NGUI: Bars size and position right after creating are now right

     
  5. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Does anyone know if you can call a playhmaker FSM from the send message in the simple Event script? say, when you r energy value reaches 0 it plays a death FSM sequence...
    Thanks!
     
  6. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello HeadTrip,

    I will send you a working example today :)
     
  7. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Thats amazing, thanks!! What excellent support!
     
  8. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Please check your inbox ;-)
     
  9. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Energy Bar Toolkit 2.1.2 (bug fix release for 2.1.x line) is out!

    Improvements
    - PlayMaker: New actions to get bar display value and set smooth effect properties

    Bug Fixes
    - Could not open sprite inspector
    - DF-GUI: Fixed visible property behavior for bars

     
  10. Lork

    Lork

    Joined:
    Jul 12, 2013
    Posts:
    79
    Having an NGUI bar seems to cause an issue with saving my scene. When the energy bar is present, the asterisk on the Unity editor's title bar never goes away when saving, and it always asks if I want to save on quit even if I've just saved. Disabling the Energy Bar Anchor in the NGUI hierarchy solves the issue and allows me to save normally, so the problem must be related to that.
     
  11. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello Lork,
    Thank you for noticing this issue.

    Dirty flag is something that I've been fighting for some time. I'll make sure (or at least try) to fix this one in the next release ;-)

    Cheers!
    Piotr
     
  12. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Energy Bar Toolkit 2.1.3 is out!

    This is the third bugfix release for 2.1.x line. If you already own 2.1.x version please update ASAP ;-)


    Cheers!
    Piotr
     
  13. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Hello,
    WhAt would be the best method for hiding the energy bar with playmaker, but keep it active (slowly lowering from my health zone)?
    Im using the old ngui method... I wantbit to toggle on/off when i remove my helmet...a visual action

    Thanks!
     
  14. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello HeadTrip,

    You can move your bar away off the screen.
    1) Enable "Relative To Transfrom" option in Position Size section
    2) Use PlayMaker change bar Transform position to something like 10000, 0, 0
    3) Move it back to 0, 0, 0 when bar should be visible again.

    Let me know if this will work!

    Cheers!
    Piotr
     
  15. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Great idea, i'll try that tonight, thanks!
     
  16. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    someone know how get acces too icon of bar reapeat by code please
     
  17. Moonstorm

    Moonstorm

    Joined:
    Jul 26, 2012
    Posts:
    23
    Hi Piotr,

    Great work so far. Really enjoying Energy Bar Toolkit. I've been having an issue described earlier in this thread but have not understood the proper solution.

    I want to have a 2D health-bar that hovers over my units much like the running robots example: http://docs.madpixelmachine.com/energybartoolkit/examples/BotRun_ManyBots/BotRun_ManyBots.html

    The main annoyance is that if the camera angle moves to the side or above, the energy bar's placement changes relative to its anchor which is a very annoying side effect. It's even present on the BotRun example posted above (you'll notice that the bar slightly moves under the bot as the bot travels from the top left to the bottom right).

    In games like StarCraft 2 or League of Legends, the HP bars stay consistently in the same place above the unit. How can you achieve this in EBT2+?

    I have tried both OnGUI bars and Mesh bars; I have tried anchoring directly on its own game object with x,y = 0 for relative positioning. I havent cracked the right method to get it to correctly hover the way it does in other RTS games.
     
  18. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello kilik128,
    For some reason I haven't received notification of your message :-(

    Are you using mesh renderers or legacy ongui renderers? If meshes then do you set your textures directly or by using atlases?

    Cheers!
    Piotr
     
  19. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    This effect is caused of simplicity of this demo. I've attached bar to bot object and I set the bar transform position to 0, -5. 0. If you want to get rid of this effect you should create a new empty gameobject that will be attached to your unit, and set it below the model. Then you should set your bar to follow this empty game object. The bar should have it's transform position set to 0, 0, 0. Here's the explanation with screenshot:

    http://energybartoolkit.madpixelmac...s/mesh/filled.html#anchor-mode--object-anchor

    Don't get confused. There's a screenshot of a bot, but this is not screenshot from bot run demo ;-)

    Cheers!
    Piotr
     
  20. Moonstorm

    Moonstorm

    Joined:
    Jul 26, 2012
    Posts:
    23
    Thanks for the quick reply! After experimenting with it some more, I have got it working but with one issue: it appears as though my "energy bar" MUST be under the Panel object inside of EnergyBarToolkit. Does this mean if I have 100 different units in the game, all of the energy bars will live inside the Panel for EBT?

    I tried setting up a similar Mesh Filled Renderer Energy Bar *outside of the panel* so I can logically attach the energy bars directly on my game units but that ends up not looking good or working quite at all the way I want. Ultimately I just want 2D style bars that follow my 3D units regardless of camera angle.
     
  21. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Yep, this is necessary, because Panel is a thing that will keep all the bars on 2D plane. I believe that you've noticed that moving bars outside a panel makes them move in 3D space and behave as 3D objects.

    Please download the unitypackage from this page http://energybartoolkit.madpixelmachine.com/demo/botrun.html and you will find an good example how to instantiate and destroy these kind of bars (BR_BotSpawnerMeshRenderer.js). Bot receives the reference to bar, so it is responsible for destroying it (BR_Bot.js).

    Please write if you have any other questions :)

    Cheers!
    Piotr
     
  22. Moonstorm

    Moonstorm

    Joined:
    Jul 26, 2012
    Posts:
    23
    Thanks for your help! Your support has been first class. Will implement the changes you suggested!

    Count me as a happy customer :)
     
  23. fieldrequired

    fieldrequired

    Joined:
    Feb 26, 2014
    Posts:
    108
    Hey there Energy Bar Man - any ideas on how I fix the issue below in the red box?

    $EBTIssue.jpg
     
  24. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello fieldrequired,

    Is this DF-GUI? I believe you have to set the DF-GUI camera to have the lower depth than Energy Bar Toolkit camera ;-)
    Please let me know about the results!

    Cheers!
    Piotr
     
  25. fieldrequired

    fieldrequired

    Joined:
    Feb 26, 2014
    Posts:
    108
    Hey, no this is NGUI and setting the camera depth doesn't seem to change it :(

    James
     
  26. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
  27. fieldrequired

    fieldrequired

    Joined:
    Feb 26, 2014
    Posts:
    108
  28. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Mesh renderers can be rotated using the Transform, OnGUI cannot. Also Mesh renderers are called something like this:
    Filled Renderer 3D

    OnGUI renderers are called like this:
    Energy Bar Renderer
     
  29. fieldrequired

    fieldrequired

    Joined:
    Feb 26, 2014
    Posts:
    108
    They are OnGUI renderers then in that case.
     
  30. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    OnGUI renderers have many issues. One of them is that they are painted always on the top layer and this cannot be changed. That's why I made them deprecated and created mesh renderers which are normal 3D objects. Please try switching to mesh renderers.

    http://energybartoolkit.madpixelmachine.com/doc/latest/components/mesh/filled.html

    Cheers!
    Piotr
     
  31. fieldrequired

    fieldrequired

    Joined:
    Feb 26, 2014
    Posts:
    108
    Oooow I had a feeling you would say something like that. Not to worry, at least there is a fix.

    Cheers,

    James
     
  32. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Energy Bar Toolkit 2.1.4 has been released!
    The fourth bugfix release of Energy Bar Toolkit is out. If you’re owner of 2.1.x line it should be safe to upgrade, so don’t hesitate :)

    Improvements
    • Reorder buttons for background/foregroud texture list
    • Changing color of background and foreground textures not longer requires bar to be rebuilt
    Bug Fixes
    • Mesh: Transform renderer rebuilder was ignoring font settings
    • Mesh: Label position was wrong when fill value was equal 0 and there was only a bar texture
     
  33. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Racing Gauges 1.2 for Energy Bar Toolkit has been released!
    After a long (too long) time 1.2 version with 3 themes is now available in the Unity Asset Store!

    All themes has been recreated using EBT atlases, so all bars are now using only 1 draw call per scene!

    Here's how the third theme looks like:


     
  34. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Note to all my clients. I am going on vacations and I won't be available as I usually am until June 23 (Monday). I am still monitoring forums and email, so no message will be leaved unanswered.

    Cheers!
    Piotr
     
  35. GCatz

    GCatz

    Joined:
    Jul 31, 2012
    Posts:
    282
    have fun ;)
     
  36. Keitaro3660

    Keitaro3660

    Joined:
    May 20, 2014
    Posts:
    86
    hurray, this is my first bought asset, because of the sale \^^/
    looks awesome so far, and i already give 5 rates :D

    i hope you always keep it update with unity, especially the nearly 4.6 version :D /
    anyway, i still waiting for Mad Level Manager for sale too <3
     
  37. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Thank you kindly!

    Thanks! :)
    Sure I will! I am using these assets in my own games, so I can make them even better with time.

    Edit: Please let me know when you will find any issues on Unity 4.5 or future versions. Even if I use these assets, I may be not aware of all of them.
     
  38. Greg-S

    Greg-S

    Joined:
    Mar 3, 2012
    Posts:
    7
    Hey. Awesome Asset. Just picked it up today.

    I had a couple questions on things I was doing and couldn't find anything in the documentation and you seem pretty awesome at responding here.

    I wanted to change the colour of the bar during runtime using scripting. The only way I found to do that so far has been:
    barBase = thisGameObject.GetComponent<EnergyBarToolkit.FilledRenderer3D>();
    barBase.textureBarColor = Color.red;

    In the documentation you commented on renderer access here: http://energybartoolkit.madpixelmachine.com/doc/2.1.4/scripting/basics.html but I couldn't access the bar colour in the EnergyBarBase script that I could find. Is this the right way to do it?

    Also, I was using the bar blinking effect which is quite nice. However I realized that the way it worked was it would trigger when you were under the value. I was planning to use it for when the bar fills, it is available for use. Like a powerup.

    So I went in and edited EnergyBarCommons to change the check to a >= instead of <=. I do realize that this method is probably not ideal as if you update, I'll lose my changes and I'll have to keep up on it for this particular project. I would be grateful if you added a toggle for the trigger on the blink to be above or below the value.

    Thanks!
     
  39. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello Greg!
    Thank you for purchasing Energy Bar Toolkit!

    Yes, this is a valid way to change bar color. I am thinking of having it more unified in future version, but currently this is the best way available. The reason behind that is because Energy Bar Toolkit grew up from very simple progress bar solution into a quite advanced one. I need to clear things up a little, but the method that you're using will be still working and it will be still OK!

    I think I can implement a modification to blinking effect to allow manual triggering. I am now on vacations, so I can do that on Monday or Tuesday. I will send you the updated version directly as soon as it is finished :)

    Please write if you have any other questions!

    Cheers!
    Piotr
     
  40. Greg-S

    Greg-S

    Joined:
    Mar 3, 2012
    Posts:
    7
    Ok. Excellent.

    Don't feel like you have to rush the modification. Can even roll it into your next update is np.

    Thank you though.
     
  41. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Energy Bar Toolkit 2.1.5 is now available!

    Energy Bar Toolkit 2.1.5 has been released and it brings in some significant performance improvements, bugfixes, and new features.

    New Features
    • Blinking can be forced in code
    • Smooth effect can be constrained to only one direction
    Bug Fixes
    • Fixed possible issue when bar is not longer anchored
    • Anchor has been always making scene dirty when set to object mode
    Improvements
    • Improved rendering performance of bars that are using atlases
    • Notably improved rendering performance of all mesh bars
     
  42. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    I'm getting this error when running the game after implementing the health bar, when following the error I found this "textureMode = serializedObject.FindProperty("textureMode");"

    Any idea on how to fix it? =x
     
  43. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello there!
    What version of EBT are you using? Could you please send me a screenshot of your configuration (inspector)? Does it happens every time? I will try to reproduce it tomorrow or by Monday.

    Cheers!
    Piotr
     
  44. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    http://puu.sh/9X4af/4a95827dcd.png
    Here :) Happens every time I hit play the game.
     
  45. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    I've tried but I cannot reproduce this :-(
    I received similar bug reports like this one, but it looks like non-repeatable Unity bug. Please try to restart your Unity editor. Does this happen also when you create a new repeated bar on a new scene?
     
  46. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    Hm, somehow I think it had something to do with having "2 cameras" showing the same layer. Or something like that, I created a new layer for the UI and di some voodoo and the error went away, not sure what it was exactly though.
     
  47. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    I need to find the reason of this and most probably report it back to Unity team then...
    Thank you for reporting this!

    Cheers!
    Piotr
     
  48. Amaresh

    Amaresh

    Joined:
    Jan 22, 2014
    Posts:
    21
    This ToolKit is awesome but it is giving me some Issues with memory. I've checked my profiler and the problem occurs when the OnGUI() function inside all your scripts is called. How can I solve this. I'm using unity 4.3.4. Hope You guys can Help.
    Thank You.
     
  49. SeriousRPG

    SeriousRPG

    Joined:
    Oct 21, 2013
    Posts:
    7
    I've done something that broke my scene. I'm using DF-GUI. I set up the Initialize (EnergyBarToolkit) with the UI Root chosen in my hierachy and UI layer (same as DFGUI uses). I did next step of adding the EnergyBar Tool from components. I realized I didn't want the toolkit at the root as I have a panel that opens/closes and wanted the bar within that panel so I deleted the game object Energy bar component and then thought I should just not save and reload scene. When I reloaded scene I get 1000's of Missing ReferenceException errors but I can't figure out what is causing it, It says the object type of EnergyBarToolkitDFAnchor has been destroyed but I am still trying to access it. I am trying to start all over so I don't believe I am using it - it must be a broken link somewhere. How do I get rid of any reference so my scene is no longer broken?

    Thanks!!
     
  50. SeriousRPG

    SeriousRPG

    Joined:
    Oct 21, 2013
    Posts:
    7
    I think I solved this. I closed Unity (reloading scene didnt help) and reopened unity and it seems to have fixed all the references. Not sure why... but who cares :)