示例#1
0
        public override void initialise()
        {
            sampleTexture = Mdx.graphics.newTexture(Mdx.files.@internal("mini2Dx.png"));
            sampleRegion  = Mdx.graphics.newTextureRegion(sampleTexture);
            sampleRegion2 = Mdx.graphics.newTextureRegion(sampleTexture).split(16, 17)[1][1];
            sampleRegion2.flip(false, true);
            sampleSprite         = Mdx.graphics.newSprite(sampleTexture);
            sampleNinePatch      = Mdx.graphics.newNinePatch(Mdx.graphics.newTexture(Mdx.files.@internal("ninepatch.png")), 6, 6, 6, 6);
            sampleAtlas          = Mdx.graphics.newTextureAtlas(Mdx.files.@internal("packfile.atlas"));
            sampleAtlasRegion    = sampleAtlas.findRegion("tileGreen", 47);
            sampleTilingDrawable = Mdx.graphics.newTilingDrawable(Mdx.graphics.newTextureRegion(Mdx.graphics.newTexture(Mdx.files.@internal("background.png"))));
            Mdx.graphicsContext.setColor(Mdx.graphics.newColor(1f, 1f, 1f, 1f));
            Mdx.graphicsContext.setBackgroundColor(new MonoGameColor(Color.Blue));
            sampleSprite.setOriginCenter();
            music = Mdx.audio.newMusic(Mdx.files.@internal("music.ogg"));
            sound = Mdx.audio.newSound(Mdx.files.@internal("sound.wav"));

            Mdx.audio.addMusicCompletionListener(new AudioCompletionListener());
            Mdx.audio.addSoundCompletionListener(new AudioCompletionListener());

            Mdx.input.newXboxGamePad((GamePad)Mdx.input.getGamePads().get(0)).addListener(new UATInputProcessor(this));

            sampleShader = Mdx.graphics.newShader("grayscaleShader");
            Mdx.graphicsContext.setFont(Mdx.fonts.newBitmapFont(Mdx.files.@internal("arial24.fnt")));
            Mdx.graphicsContext.getFont().setColor(Mdx.graphics.newColor(255, 255, 255, 255));
            sampleFontCache = Mdx.graphicsContext.getFont().newCache();
            sampleFontCache.setColor(Mdx.graphics.newColor(255, 255, 255, 255));
            sampleFontCache.addText("Hello!\nBonjour!\nCiao!\nGuten tag!\nNamaste!", 400, 165, 100, Align.LEFT, true);
            sampleFontCache.addText("Hello!\nBonjour!\nCiao!\nGuten tag!\nNamaste!", 500, 165, 100, Align.CENTER, true);
            sampleFontCache.addText("Hello!\nBonjour!\nCiao!\nGuten tag!\nNamaste!", 600, 165, 100, Align.RIGHT, true);
            sampleMap = new TiledMap(Mdx.files.@internal("orthogonal_no_cache.tmx"));
            Mdx.input.setInputProcessor(new UATInputProcessor(this));
        }
示例#2
0
 public void drawFontCache(GameFontCache gameFontCache)
 {
     gameFontCache.draw(this);
 }
示例#3
0
 public void drawFontCache(GameFontCache gameFontCache)
 {
     throw new System.NotImplementedException();
 }