September 19, 2017, 08:14:27 AM

Author Topic: Fix Haxepunk to work with new Lime (+3.2) and Openfl (+4.1)...  (Read 1018 times)

xmorpher

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
Fix Haxepunk to work with new Lime (+3.2) and Openfl (+4.1)...
« on: September 28, 2016, 03:53:38 PM »
As we know, Haxepunk doesn't work in the new versions of OpenFl and Lime
since the "Tilesheet" Class was removed from openfl
But apparently the "Tilemap" class can be used instead:
http://community.openfl.org/t/proposal-tilemap-changes/7904/53?u=xmorpher
Quote
@singmajesty: Tilemap can do much of the work of the old Tilesheet class, but without the same bugs, and with better performance. There are a few key differences (Tilemap preserves state between renders, is "passive" not "active" in rendering and is a DisplayObject) but should otherwise should do the job
I love HaxePunk and use it on my mobile projects
but right now is deprecated because it doesn't work with new libs and extensions

Proposal: can we make HaxePunk compatible with the new Lime and Openfl versions
using the TileMap instead of Tilesheet class?
Can we create a group of testing/programming to achieve this?

xmorpher

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
Re: Fix Haxepunk to work with new Lime (+3.2) and Openfl (+4.1)...
« Reply #1 on: September 28, 2016, 04:05:27 PM »
Proposal: Tilemap changes (singmajesty)
http://community.openfl.org/t/proposal-tilemap-changes/7904?u=xmorpher

(You can propose things to make easier the change from Tilesheet to Tilemaps...)

Quote
@singmajesty: Hi everyone!

The Tilemap API is in beta, and as more developers have started to use it, we have started to get some feedback on things that people prefer and don't prefer about the API.

Change for it's own sake is not ideal, but we are early enough in this process that I would like to talk about whether we should consider making some changes—API changes now are going to be easier than if we wait.

This is an example of how the Tilemap API might look in a project:
Code: [Select]
var bitmapData = Assets.getBitmapData ("tiles.png");
var tileset = new Tileset (bitmapData);
tileset.addTileRect (new Rectangle (0, 0, 100, 100));

var tilemap = new Tilemap (800, 600);

var tilemapLayer = new TilemapLayer (tileset);
var tile = new Tile (0);

tilemapLayer.addTile (tile);
tilemap.addLayer (tilemapLayer);
addChild (tilemap);
There is one Tileset per BitmapData, you can add tile rectangles to the tileset, which generates new tile IDs. Anyone who has used drawTiles or another batch tiling API should recognize this portion.

The Tilemap object is an OpenFL DisplayObject, which is later added to the display list. This is what controls where and how all of our tiles will be drawn. The current API allows for any number of TilemapLayer objects, which contain Tile instances. Each one of these Tile instances holds a tile ID, x, y, scale, rotation or other draw information needed when perform the final render.

TilemapLayer is locked to one Tileset only, and represents one draw call on the GPU. If you need more than one Tileset, you will need to separate into multiple layers, increasing the number of draw calls.
(...)
continues here:
http://community.openfl.org/t/proposal-tilemap-changes/7904?u=xmorpher



bendmorris

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 84
    • View Profile
Re: Fix Haxepunk to work with new Lime (+3.2) and Openfl (+4.1)...
« Reply #2 on: September 30, 2016, 12:25:47 AM »
Unfortunately Tilemap doesn't have all the features that drawTiles did, so it's not a suitable replacement at the moment.

For native targets, using NME instead is a possibility: https://github.com/haxenme/nme

bendmorris

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 84
    • View Profile
Re: Fix Haxepunk to work with new Lime (+3.2) and Openfl (+4.1)...
« Reply #3 on: October 08, 2016, 01:17:25 AM »
Update: this is now merged. Check out the latest dev branch from Github and you can use OpenFL 4+ and Lime 3+.

xmorpher

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
Re: Fix Haxepunk to work with new Lime (+3.2) and Openfl (+4.1)...
« Reply #4 on: March 02, 2017, 12:48:27 PM »
Great!

Thanks!! ;D

reaperspeeds

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Fix Haxepunk to work with new Lime (+3.2) and Openfl (+4.1)...
« Reply #5 on: September 06, 2017, 11:11:41 AM »
Update: this is now merged. Check out the latest dev branch from Github and you can use OpenFL 4+ and Lime 3+.

Theirs any documentation or examples where we can make the changes of code?

I know that in the github have some, but I need to use multitouch and i dont find where is it....

Thanks.