- Joined
- Jan 26, 2014
- Messages
- 1,281
- Reaction score
- 106
- First Language
- Irish
- Primarily Uses
- N/A
I have some problem over src_rect.height. I am using an image as a representation of the said sprite:
def initialize super(nil) self.bitmap = Cache.picture('human_vein') src_rect.height = $game_party.members[0].hp.to_f / $game_party.members[0].mhp * 100 endNote that this is created in a new class inherited in a sprite class. There is nothing wrong in this code, however, my problem is how it handles it in the update method.
def update super src_rect.height = $game_party.members[0].hp.to_f / $game_party.members[0].mhp * 100 endInstead of decreasing downwards, it decreases upwards. Say you use a Heart as an image, instead of it decreasing from above, it decreases from below.
Is there a way to reverse this function so it would decrease downwards?
My problem is graphed this way:
def initialize super(nil) self.bitmap = Cache.picture('human_vein') src_rect.height = $game_party.members[0].hp.to_f / $game_party.members[0].mhp * 100 endNote that this is created in a new class inherited in a sprite class. There is nothing wrong in this code, however, my problem is how it handles it in the update method.
def update super src_rect.height = $game_party.members[0].hp.to_f / $game_party.members[0].mhp * 100 endInstead of decreasing downwards, it decreases upwards. Say you use a Heart as an image, instead of it decreasing from above, it decreases from below.
Is there a way to reverse this function so it would decrease downwards?
My problem is graphed this way:
