Package fm.ak.otse.twod

Examples of fm.ak.otse.twod.Sprite


        }

        // draw timage and tdecal
        for ( int i = 0; i < 2; i++ ) {
            sheet.getTexture().bind();
            Sprite sprite = null;
           
            int rot = 0;
           
            float tr[][] {{-1,-1}, {1,0}, {1,-1}, {0,-1}};
            float ar[] =    {-1,      90,    180,     270};
           
            if ( i == 0 ) { // image
                sprite = timage;
                rot = timagerot;
            }
            else if ( i == 1 ) { // decal
                sprite = tdecal;
                rot = tdecalrot;
            }
           
            if ( sprite == null )
                break;
           
            if ( rot > 0 ) {
                glPushMatrix();
                glTranslatef(tr[rot][0] * 40, -tr[rot][1] * 40, 0);   
                glRotatef(ar[rot], 0, 0, 1);
            }
           
            float TW = Tile.sheet.getTexture().getTextureWidth();
            float TH = Tile.sheet.getTexture().getTextureHeight();
           
            float tx = (float) sprite.x() / TW;
            float ty = (float) sprite.y() / TH;
            float tw = ((float) 40 / TW) + tx;
            float th = ((float) 40 / TH) + ty;
           
            glBegin(GL_QUADS);
           
View Full Code Here


*/
public class Static {

    static void fillSprites() {
        // datagrams
        Main.main.main.sheet1.sprite("puzzle", new Sprite(24, 476, 12, 12));
        Main.main.sheet1.sprite("puzzleshadow", new Sprite(24, 488, 21, 15));
        Main.main.sheet1.sprite("region", new Sprite(36, 476, 12, 12));
        Main.main.sheet1.sprite("entity", new Sprite(24, 476, 12, 12));
       
        // ble
        Main.main.sheet1.sprite("player", new Sprite(0, 476, 12, 12));
        Main.main.sheet1.sprite("marker", new Sprite(48, 476, 40, 40));
        Main.main.sheet1.sprite("exit", new Sprite(88, 476, 40, 40));
       
        // blu
        Main.main.sheet1.sprite("sel", new Sprite(12, 476, 6, 6));
        Main.main.sheet1.sprite("uns", new Sprite(18, 476, 6, 6));
       
        // large
        Main.main.sheet1.sprite("lgrass", new Sprite(0, 316, 160, 160));
       
        // road
        Main.main.sheet1.sprite("rturn1", new Sprite(0, 235, 40, 40));
        Main.main.sheet1.sprite("rdoor1", new Sprite(123, 235, 40, 40));
        Main.main.sheet1.sprite("rplain1", new Sprite(82, 235, 40, 40));
        Main.main.sheet1.sprite("rside1", new Sprite(41, 235, 40, 40));
        Main.main.sheet1.sprite("rcorner1", new Sprite(164, 235, 40, 40));
       
        // bad road
        Main.main.sheet1.sprite("rbadcorner1", new Sprite(410, 235, 40, 40));
        Main.main.sheet1.sprite("rbaddoor1", new Sprite(369, 235, 40, 40));
        Main.main.sheet1.sprite("rbadside1", new Sprite(328, 235, 40, 40));
        Main.main.sheet1.sprite("rbadside2", new Sprite(287, 235, 40, 40));
        Main.main.sheet1.sprite("rbadturn1", new Sprite(246, 235, 40, 40));
        Main.main.sheet1.sprite("rbadturn2", new Sprite(205, 235, 40, 40));
       
       
        // building
        Main.main.sheet1.sprite("bplain1", new Sprite(451, 235, 40, 40));
       
        // decals
        Main.main.sheet1.sprite("dblast1", new Sprite(369, 276, 40, 40));
        Main.main.sheet1.sprite("dzebra1", new Sprite(410, 276, 40, 40));
        Main.main.sheet1.sprite("dzebra2", new Sprite(451, 276, 40, 40));
    }
View Full Code Here

        if ( null == last  ||  quoteCount++ > &&  XD.nextInt(4) == 1 ) { // 1 in 3
            //quote(witty[XD.nextInt(witty.length)]);
            quoteCount = 0;
        }
       
        Sprite s2 = sheet.sprite("puzzleshadow");
        shadow = new Component("$datagram shadow", 50, 50, s2.w(), s2.h());
        shadow.setSheetSprite(sheet, "puzzleshadow");
        shadow.index = 5;
        //shadow.visibile = false;
        //Component.queue.add(shadow);
View Full Code Here

TOP

Related Classes of fm.ak.otse.twod.Sprite

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.