Sign in to follow this  
Followers 0
Dazzler

Skulls and things

3 posts in this topic

#1 ·  Posted (edited)

People,

I am designing a graphic to show the current health of a player for a game.

I have 2 equally sized jpgs: a skull and a helmet.

As the player's health lessens so more skull is shown and less helmet; vica versa.

So if health is 50%; we get the left half of the helmet and the right half of the skull.

Therein lies the problem. If I leave the width and height values of guictrlcreatepic as 0, the picture is not resized--this is excellent: however, the pic on the right will only show the right half--I need the left half. Is there a way of right aligning a jpg?

See attached.

Ideally I simply increment one picture width and decrement the other. I could just have a series of jpgs showing the series of 100% helmet/0% skull to 0%helmet/100% skull but where's the coding challenge in that.

Edited by Jos

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

This could be done with setpos.

have a look at the following code, it will give you a general idea of how you could do it.

Same counts for you... Read our rules! Jos

Edited by Jos

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0