Draw function works in Android/Flash but not in HTML5



  • Hi,

    I'm trying to draw a texture mapped quad and it works in the Flash and Android targets but not in the HTML5 target.

    I'm calling this test function from create() in my FlxState screen:

    function addImage(pathToImage:String) 
    {
        strip = new FlxStrip(0, 0, pathToImage);
    	vertices = strip.vertices;
        vertices.push(0);
        vertices.push(0);
        
        vertices.push(100);
        vertices.push(0);
        
        vertices.push(100);
        vertices.push(100);
        
        vertices.push(0);
        vertices.push(100);
        
    	ids = strip.indices;
        ids.push(0);
        ids.push(1);
        ids.push(3);
        
        ids.push(1);
        ids.push(2);
        ids.push(3);
        
    	uvtData = strip.uvtData;
        uvtData.push(0);
        uvtData.push(0);
        
        uvtData.push(1);
        uvtData.push(0);
        
        uvtData.push(1);
        uvtData.push(1);
        
        uvtData.push(0);
        uvtData.push(1);
        
        add(strip);
    }
    

    In the game I'm trying to port I need to draw textured quads instead of sprites (they get distorted) and I need to draw 100 or so of them efficiently.

    Any idea what I need to change to make it work in both Android and HTML5?


  • administrators

    I'm not sure if FlxStrip is supported on HTML5. Feel free to raise an issue on GitHub.



  • Turns out this is broken because the backing openfl implementation is broken on HTML5. I've opened an issue on github.


  • administrators

    Nice!

    Here's a link to mentioned issue if anyone stumbles over this via Google: https://github.com/openfl/openfl/issues/1253


Log in to reply