Hi,
i am new for here - I am willing to develop with haxe and lime but i am surpised because it is very slower than Flash Player 20 “Drawing grid byHaxe, Lime and Openfl” like 2D Grids.
I have own example from AS3:
package
{
import flash.display.Sprite;
public class Grid extends Sprite
{
public function Grid()
{
super();
drawGrid();
}
private var grid:Sprite = new Sprite();
private var numColumns:Number = 128;
private var numRows:Number = 128;
private var cellHeight:Number = 32;
private var cellWidth:Number = 32;
private function drawGrid():void
{
grid.graphics.clear();
grid.graphics.lineStyle(1, 0x000000);
// we drop in the " + 1 " so that it will cap the right and bottom sides.
for (var col:Number = 0; col < numColumns + 1; col++)
{
for (var row:Number = 0; row < numRows + 1; row++)
{
trace(col, row);
grid.graphics.moveTo(col * cellWidth, 0);
grid.graphics.lineTo(col * cellWidth, cellHeight * numRows);
grid.graphics.moveTo(0, row * cellHeight);
grid.graphics.lineTo(cellWidth * numColumns, row * cellHeight);
}
}
addChild(grid);
}
}
}
To Haxe format:
package;
import openfl.display.Sprite;
class Main extends Sprite {
private var _grid:Sprite = new Sprite();
private var _numCols:Int = 128;
private var _numRows:Int = 128;
private var _cellHeight:Float = 16;
private var _cellWidth:Float = 16;
public function new () {
super ();
_grid.graphics.clear();
_grid.graphics.lineStyle(1, 0x000000);
for(col in 0..._numCols)
{
for(row in 0..._numRows)
{
trace(col, row);
_grid.graphics.moveTo(col * _cellWidth, 0);
_grid.graphics.lineTo(col * _cellWidth, _cellHeight * _numRows);
_grid.graphics.moveTo(0, row * _cellHeight);
_grid.graphics.lineTo(_cellWidth * _numCols, row * _cellHeight);
}
}
addChild(_grid);
}
}
Has haxe problem with encoder and copypixel?
Please fix openfl, lime and haxe frameworks thanks
PS: you know that fast drawing http://jacksondunstan.com/articles/506
thanks
and download - if you try my gridexample.
Best regards from Germany