Page 1 of 1

Table / Double Alcove code

Posted: Fri Feb 22, 2013 11:54 pm
by Ser Xav
Hi all, I'm planning on making a stone table custom object in DSB. Have looked over the code for the double alcove wallitem object from Sophia's Test Dungeon, figuring I would need to employ some similar code for a table onto which objects can be placed, but make it a floor standing object instead of a wall item (using a THING type?). Is this essentially the right way to go?

In terms of the gfx offsets.... in the Test Dungeon doublealcoves.lua file, one of the alcoves has: .y_off =-40

...for it's custom bitmap for 'alcove_short_front'. I assume this means draw bitmaps 40 pixels below a reference point...?

The other alcove - 'alcove_short_front_top' - has: .y_off=72 I assume means 72 pixels above a reference point...?

Can someone explain the basics of bitmaps placement and principles behind the co-ordinates?

Thanks! :-)

Re: Table / Double Alcove code

Posted: Fri Feb 22, 2013 11:59 pm
by Sophia
You've basically figured it out.

Wallitems are, by default, drawn in the center of the wall. Most items "just work" without need of any explicit offset.
The two alcoves need explicit offsets so one is drawn higher and the other is drawn lower.

The only thing you've gotten wrong the axes: 0,0 is in the upper left corner, so negative is up and positive is down.