02-22-2023, 10:00 PM
(This post was last modified: 02-22-2023, 10:02 PM by DerVVulfman.)
Well, the layers used when creating the final resulting bitmap may not be 'resized' to suit you, icogil. But the layers can be controlled as to where the player is when it comes to layering. By that, I can draw things like a shield 'behind' the actor if he/she is facing the right of the screen. And the shield draws 'over' the actor when facing left. So my 'layering' system that happens automatically is now working.
# CONSTANT SLOTS
# ==============
# Add, remove or change the value of constants to match the slots
# used in your system.
# ======================================================================
BODY = 0 # (FAKE SLOT) Reserved for the Subject's body
RIGHT = 1 # Slot for the Right hand ... weapon
LEFT = 2 # Slot for the Left Hand ... weapon or shield
HELMET = 3 # Slot for the Helmet
ARMOR = 4 # Slot for the Armor
ACCESSORY = 5 # Slot for the Accessory
# SLOT ORDER STYLE
# ================
# This array defines the order in which your graphics are drawn based
# on the slots. Easy to use, just fill in with the IDs of the contants
# defined above.
# ======================================================================
ORDER_STYLE[2] = [ BODY, ARMOR, HELMET, ACCESSORY, LEFT, RIGHT]
ORDER_STYLE[4] = [ BODY, ARMOR, HELMET, ACCESSORY, LEFT, RIGHT]
ORDER_STYLE[6] = [ LEFT, BODY, ARMOR, HELMET, ACCESSORY, RIGHT]
ORDER_STYLE[8] = [ BODY, ARMOR, HELMET, ACCESSORY, LEFT, RIGHT]
The first section, the CONSTANT SLOTS section, lets you identify the equipment slots. Not really hard to understand, you have five equipment slots in your game including your weapon, so the RIGHT hand is your weapon and the LEFT is typically your shield *No suggesting left-handers, guys!! And for convenience, I just set up a constant for the default actor sprite, the BODY slot.
The second section, the ORDER STYLE section, allows you to define the way all the graphic layers are applied based on the direction your sprite is facing. So visibly show, we have four arrays indicating if the sprite is facing down, left, right and up. Most of the time, it would be the same... or you would ASSUME it would be the same. But when the sprite faces right (6), then the way the graphic layers are put together changes... the item (shield) in the LEFT slot is drawn first before even the character's body... so it is hidden behind the character.
Yes. This means that the graphics are updated, not only when your characters' equipment changes, but when your sprite(s) change direction. Already tested and it is quite nice.
The beginning of true layering!
More cleaning and work needs to be performed. But after that, methinks 'sizes' may be next?
# CONSTANT SLOTS
# ==============
# Add, remove or change the value of constants to match the slots
# used in your system.
# ======================================================================
BODY = 0 # (FAKE SLOT) Reserved for the Subject's body
RIGHT = 1 # Slot for the Right hand ... weapon
LEFT = 2 # Slot for the Left Hand ... weapon or shield
HELMET = 3 # Slot for the Helmet
ARMOR = 4 # Slot for the Armor
ACCESSORY = 5 # Slot for the Accessory
# SLOT ORDER STYLE
# ================
# This array defines the order in which your graphics are drawn based
# on the slots. Easy to use, just fill in with the IDs of the contants
# defined above.
# ======================================================================
ORDER_STYLE[2] = [ BODY, ARMOR, HELMET, ACCESSORY, LEFT, RIGHT]
ORDER_STYLE[4] = [ BODY, ARMOR, HELMET, ACCESSORY, LEFT, RIGHT]
ORDER_STYLE[6] = [ LEFT, BODY, ARMOR, HELMET, ACCESSORY, RIGHT]
ORDER_STYLE[8] = [ BODY, ARMOR, HELMET, ACCESSORY, LEFT, RIGHT]
The first section, the CONSTANT SLOTS section, lets you identify the equipment slots. Not really hard to understand, you have five equipment slots in your game including your weapon, so the RIGHT hand is your weapon and the LEFT is typically your shield *No suggesting left-handers, guys!! And for convenience, I just set up a constant for the default actor sprite, the BODY slot.
The second section, the ORDER STYLE section, allows you to define the way all the graphic layers are applied based on the direction your sprite is facing. So visibly show, we have four arrays indicating if the sprite is facing down, left, right and up. Most of the time, it would be the same... or you would ASSUME it would be the same. But when the sprite faces right (6), then the way the graphic layers are put together changes... the item (shield) in the LEFT slot is drawn first before even the character's body... so it is hidden behind the character.
Yes. This means that the graphics are updated, not only when your characters' equipment changes, but when your sprite(s) change direction. Already tested and it is quite nice.
The beginning of true layering!
More cleaning and work needs to be performed. But after that, methinks 'sizes' may be next?