class Demiurge::DSL::TmxLocationBuilder
Special builder for tmx_location blocks
Public Class Methods
new(name, engine, options = {})
click to toggle source
Constructor
Calls superclass method
Demiurge::DSL::LocationBuilder::new
# File lib/demiurge/tmx.rb, line 70 def initialize(name, engine, options = {}) options["type"] ||= "TmxLocation" super end
Public Instance Methods
built_item()
click to toggle source
Validate built_item
before returning it
Calls superclass method
# File lib/demiurge/tmx.rb, line 88 def built_item raise("A TMX location (name: #{@name.inspect}) must have a tile layout!") unless @state["tile_layout_filename"] item = super item.tile_cache_entry # Load the cache entry, make sure it works without error item end
manasource_tile_layout(tmx_spec)
click to toggle source
Specify a TMX file as the tile layout, and interpret it according to ManaSource TMX conventions.
# File lib/demiurge/tmx.rb, line 82 def manasource_tile_layout(tmx_spec) @state["tile_layout_filename"] = tmx_spec @state["tile_layout_type"] = "manasource" end
tile_layout(tmx_spec)
click to toggle source
Specify a TMX file as the tile layout, but assume relatively little about the TMX format.
# File lib/demiurge/tmx.rb, line 76 def tile_layout(tmx_spec) @state["tile_layout_filename"] = tmx_spec @state["tile_layout_type"] = "tmx" end