Skip to content
aubergine10 edited this page Oct 27, 2015 · 6 revisions

##Overview

The RenderPreOffset setting determines the z-index of the second sprite associated with an object.

##Syntax

This optional setting is used in materials.txt and must be within a BEGIN Object ... definition block. It can be used only once per definition block.

    RenderPreOffset <number>

Where <number> is an integer (positive or negative). This is added to the object's RenderDepth setting to determine the z-index (render depth) of the second sprite.

##Example

    RenderPreOffset     3

##Scripting

Scripts cannot currently access this setting.

##Notes

To try and explain this setting, we'll refer to a base game object that uses it - the RoadGate door. It consists of two sprites:

  • RoadGate - the big door that slides sideways when the door opens
  • RoadGatePosts - the pillars either side of the gate that don't move

Here are some pertinent settings from the definition of RoadGate in materials.txt:

You notice two things - the RoadGatePosts and their render depth aren't defined.

The render depth is determined as follows:

RoadGatePosts RenderDepth = RoadGate RenderDepth + RenderPreOffset

The z-indexes (render depths) are therefore:

  • 2 - RoadGate and Vehicles
  • 0 - RoadGatePosts

Because RoadGate is on same z-index as the vehicles it will block their movement when closed, while the RoadGatePosts which are on a lower z-index will not block movement.

And how is the second sprite defined to be RenderGatePosts? We don't know - assumption is that it's hard-coded in game.

We also don't know what the difference is between RenderPreOffset and RenderPostOffset.

It's not yet known if you can use RenderPostOffset in conjunction with sprites.png format [Sprite](Sprite (sprites.png)) settings which allow you to define multiple sprites in the object's definition block.

##See Also

^ Open "Pages" to Search



Settings:

* = multi-use per block
... = BEGIN...END block

Equipment:

Name Sprite AttackPower num RechargeTime num Properties Weapons Properties NoImport Properties Improvised Properties Metal Properties Tools Scale TwoHanded true|false Range num Rotatable true|false - eg. book

Callouts:

Name Cost num MaxNumber num Vehicle vehicleId Entity entityId NumEntities Sprite

Clone this wiki locally