The Daily Click ::. Forums ::. Klik Coding Help ::. Graphic error. part of a moving counter gets left behind sometimes - mfa provided
 

Post Reply  Post Oekaki 
 

Posted By Message

Fifth

Quadruped

Registered
  07/05/2003
Points
  5818

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
28th December, 2015 at 28/12/2015 09:54:40 -

There are a few ways you could do a sort of "crop instead of resize" thing, but they mostly need extra extensions, and might be a little much for your purposes.

The simplest one I can think of would be to use a small Text Blitter object for each health bar. You could make a single text-character to be the health bar's graphic, and then alter the object's X size/character width to change its value.

 
Go Moon!

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
4th January, 2016 at 04/01/2016 00:14:22 -

The most effective method is to write a shader which returns 0 color on an output greater than float value x.
You can make one by taking an existing shader and changing the code around.

there are 4 types of shaders:
color,deform, both or render
render simply draws something mathematical like plasma.

about coding shaders:
shaders work by running the same tiny piece of code 900 times (x * y times).
each cycle you should loads a unique x/y co-ordinate. run your equations, then output the new co-ordinate with 'out.color' function (usually). 'out.color' can also load the color for the current co-ordinate, and be modified on the output. x,y co-ordinates in a shader are between 0 and 1 (float), meaning left and right/top and bottom of the object with a shader. There's lots of junk code which doesn't really do anything. Find the code that actually does something by changing numbers. Then insert your own code, you may like to define your own variable.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click