Hello, I would like to use the Hexmap feature, however the test and samples
folders do not have an implementation. I've adapted the tile_test program
and dived into the source to see how to format the xml. It is supposed to
show a 4x4 hex 'grid'. It gives no errors, but does give a blank screen. Is
the following looking at all correct or did I just screw things up?
Code:
import cocos
from cocos import tiles, actions, layer
def main():
from cocos.director import director
director.init(width=600, height=600, resizable=True)
scroller = layer.ScrollingManager()
tile_layer = tiles.load('tile-map.xml')['map0']
scroller.add(tile_layer)
scroller.set_focus(10,10)
main_scene = cocos.scene.Scene(scroller)
director.run(main_scene)
if __name__ == '__main__':
main()
tile-map.xml:
<resource>
<requires file="tile-tile.xml" />
<hexmap id="map0" origin="20,0,0" tile_height="168">
<column>
<cell title="h0" /><cell title="h0" /><cell title="h0" /><cell title="h0" />
</column>
<column>
<cell title="h0" /><cell title="h0" /><cell title="h0" /><cell title="h0" />
</column>
<column>
<cell title="h0" /><cell title="h0" /><cell title="h0" /><cell title="h0" />
</column>
<column>
<cell title="h0" /><cell title="h0" /><cell title="h0" /><cell title="h0" />
</column>
</hexmap>
</resource>
tile-tile.xml:
<resource>
<imageatlas size="168x168" file="Regular_hexagon.png">
<image id="h0" offset ="0,0"/>
</imageatlas>
<tileset>
<tile id="h0">
<image ref="h0"/>
</tile>
</tileset>
</resource>
Thanks very much for taking a look! I can also zip the folder and attach if
that would be easier.
Cheers,
Tom
--
You received this message because you are subscribed to the Google Groups
"cocos2d discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cocos-discuss.
For more options, visit https://groups.google.com/groups/opt_out.