How to use the textures/cross.png function in textures

To help you get started, we’ve selected a few textures examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github turbulenz / turbulenz_engine / samples / tsscripts / templates / datashares.ts View on Github external
draw2D.configure({
                viewportRectangle : [0, 0, stageWidth, stageHeight],
                scaleMode : 'scale'
            });

            boardSprite = Draw2DSprite.create({
                texture : textures['textures/tictactoeboard.png'],
                x: boardOffsetX,
                y: boardOffsetY,
                width : boardSizeX,
                height: boardSizeY,
                origin: [0, 0]
            });

            pieceTextures.O = textures['textures/nought.png'];
            pieceTextures.X = textures['textures/cross.png'];

            var x, y;
            var pieceWidth = boardSizeX / 3;
            var pieceHeight = boardSizeY / 3;
            for (x = 0; x < 3; x += 1)
            {
                for (y = 0; y < 3; y += 1)
                {
                    var pieceX = boardOffsetX + pieceWidth * x;
                    var pieceY = boardOffsetY + pieceHeight * y;
                    pieceSprites.O[x + y * 3] = Draw2DSprite.create({
                        texture : pieceTextures.O,
                        x: pieceX,
                        y: pieceY,
                        width : pieceWidth,
                        height: pieceHeight,
github turbulenz / turbulenz_engine / apps / tictactoe / tsscripts / tictactoe / tictactoeapp.ts View on Github external
var boardOffsetX = this.boardOffsetX;
            var boardOffsetY = this.boardOffsetY;
            var boardSizeX = this.boardSizeX;
            var boardSizeY = this.boardSizeY;

            this.boardSprite = Draw2DSprite.create({
                texture : textures['textures/tictactoeboard.png'],
                x: boardOffsetX,
                y: boardOffsetY,
                width : boardSizeX,
                height: boardSizeY,
                origin: [0, 0]
            });

            pieceTextures.O = textures['textures/nought.png'];
            pieceTextures.X = textures['textures/cross.png'];

            var pieceWidth = boardSizeX / 3;
            var pieceHeight = boardSizeY / 3;
            var pieceSprites = this.pieceSprites;
            var x, y;
            for (x = 0; x < 3; x += 1)
            {
                for (y = 0; y < 3; y += 1)
                {
                    var pieceX = boardOffsetX + pieceWidth * x;
                    var pieceY = boardOffsetY + pieceHeight * y;
                    pieceSprites.O[x + y * 3] = Draw2DSprite.create({
                        texture : pieceTextures.O,
                        x: pieceX,
                        y: pieceY,
                        width : pieceWidth,