當前位置: 首頁>>代碼示例>>Java>>正文


Java AppGameContainer.setDisplayMode方法代碼示例

本文整理匯總了Java中org.newdawn.slick.AppGameContainer.setDisplayMode方法的典型用法代碼示例。如果您正苦於以下問題:Java AppGameContainer.setDisplayMode方法的具體用法?Java AppGameContainer.setDisplayMode怎麽用?Java AppGameContainer.setDisplayMode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.newdawn.slick.AppGameContainer的用法示例。


在下文中一共展示了AppGameContainer.setDisplayMode方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: startGame

import org.newdawn.slick.AppGameContainer; //導入方法依賴的package包/類
/**
 * This method starts the game 
 * @param mode identify the modality of the game 
 */
public void startGame(String mode){
    try
    {
        this.mode = mode;
        MazeView vl = new MazeView(this, mode);
        AppGameContainer app = new AppGameContainer(vl);
        app.setDisplayMode(608, 704, false);
       
        if(mode.equals("extreme"))
            app.setTargetFrameRate(260);
        else 
            app.setTargetFrameRate(60);

        app.setShowFPS(false);
        app.start();
    }
    catch (SlickException e)
    {
        e.printStackTrace();
    }
}
 
開發者ID:IngSW-unipv,項目名稱:Progetto-C,代碼行數:26,代碼來源:PacmanGame.java

示例2: update

import org.newdawn.slick.AppGameContainer; //導入方法依賴的package包/類
@Override
public void update(GameContainer gc, StateBasedGame sbg, int i) throws SlickException {
    if (shouldToggleFullscreen) {
        shouldToggleFullscreen = false;
        boolean fs = !gc.isFullscreen();
        AppGameContainer agc = (AppGameContainer)gc;
        agc.setDisplayMode(fs ? agc.getScreenWidth() : Application.DISPLAY_WIDTH,
                           fs ? agc.getScreenHeight() : Application.DISPLAY_HEIGHT, fs);
    }
    if (gc.getInput().isKeyPressed(Input.KEY_ENTER)) {
        click.play(1.0f, CLICK_VOLUME);
        mainMenu.fade(1000, 0.0f, true);
        sbg.enterState(Application.GAME, new FadeOutTransition(Color.black, 1000), new EmptyTransition());
    }
    if (gc.getInput().isKeyPressed(Input.KEY_C)) {
        sbg.enterState(Application.CREDITS);
    }
}
 
開發者ID:j-dong,項目名稱:trashjam2017,代碼行數:19,代碼來源:MainMenu.java

示例3: main

import org.newdawn.slick.AppGameContainer; //導入方法依賴的package包/類
/**
 * Entry point to our simple test
 * 
 * @param args The arguments supplied to the test
 * @throws SlickException Indicates a failure loading or processing resources 
 * @throws IOException Indicates a failure loading the font
 */
public static void main(String[] args) throws SlickException, IOException {
	Input.disableControllers();
	AppGameContainer container = new AppGameContainer(new UnicodeFontTest());
	container.setDisplayMode(512, 600, false);
	container.setTargetFrameRate(20);
	container.start();
}
 
開發者ID:j-dong,項目名稱:trashjam2017,代碼行數:15,代碼來源:UnicodeFontTest.java

示例4: main

import org.newdawn.slick.AppGameContainer; //導入方法依賴的package包/類
/**
 * Entry point to our test
 * 
 * @param argv The arguments passed to the test
 */
public static void main(String[] argv) {
    try {
    	Renderer.setRenderer(Renderer.VERTEX_ARRAY_RENDERER);
        AppGameContainer container = new AppGameContainer(new ShapeTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
 
開發者ID:j-dong,項目名稱:trashjam2017,代碼行數:16,代碼來源:ShapeTest.java

示例5: main

import org.newdawn.slick.AppGameContainer; //導入方法依賴的package包/類
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test, not used here
 */
public static void main(String[] argv) {
	try {
		AppGameContainer container = new AppGameContainer(new DuplicateEmitterTest());
		container.setDisplayMode(800,600,false);
		container.start();
	} catch (SlickException e) {
		e.printStackTrace();
	}
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:15,代碼來源:DuplicateEmitterTest.java

示例6: main

import org.newdawn.slick.AppGameContainer; //導入方法依賴的package包/類
/**
 * Entry point to our test
 * 
 * @param argv The arguments passed to the test
 */
public static void main(String[] argv) {
	try {
		Renderer.setLineStripRenderer(Renderer.QUAD_BASED_LINE_STRIP_RENDERER);
		Renderer.getLineStripRenderer().setLineCaps(true);
		
		AppGameContainer container = new AppGameContainer(new LineRenderTest());
		container.setDisplayMode(800,600,false);
		container.start();
	} catch (SlickException e) {
		e.printStackTrace();
	}
}
 
開發者ID:IngSW-unipv,項目名稱:Progetto-C,代碼行數:18,代碼來源:LineRenderTest.java

示例7: main

import org.newdawn.slick.AppGameContainer; //導入方法依賴的package包/類
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test
 */
public static void main(String[] argv) {
	try {
		Renderer.setRenderer(Renderer.VERTEX_ARRAY_RENDERER);
		
		AppGameContainer container = new AppGameContainer(new GradientTest());
		container.setDisplayMode(800,600,false);
		container.start();
	} catch (SlickException e) {
		e.printStackTrace();
	}
}
 
開發者ID:j-dong,項目名稱:trashjam2017,代碼行數:17,代碼來源:GradientTest.java

示例8: main

import org.newdawn.slick.AppGameContainer; //導入方法依賴的package包/類
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test
 */
public static void main(String[] argv) {
	try {
		AppGameContainer container = new AppGameContainer(new FlashTest());
		container.setDisplayMode(800,600,false);
		container.start();
	} catch (SlickException e) {
		e.printStackTrace();
	}
}
 
開發者ID:j-dong,項目名稱:trashjam2017,代碼行數:15,代碼來源:FlashTest.java

示例9: main

import org.newdawn.slick.AppGameContainer; //導入方法依賴的package包/類
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test
 */
public static void main(String[] argv) {
	try {
		AppGameContainer container = new AppGameContainer(new BigSpriteSheetTest());
		container.setDisplayMode(800,600,false);
		container.start();
	} catch (SlickException e) {
		e.printStackTrace();
	}
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:15,代碼來源:BigSpriteSheetTest.java

示例10: main

import org.newdawn.slick.AppGameContainer; //導入方法依賴的package包/類
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test
 */
public static void main(String[] argv) {
	try {
		TestBox box = new TestBox();
		box.addGame(AnimationTest.class);
		box.addGame(AntiAliasTest.class);
		box.addGame(BigImageTest.class);
		box.addGame(ClipTest.class);
		box.addGame(DuplicateEmitterTest.class);
		box.addGame(FlashTest.class);
		box.addGame(FontPerformanceTest.class);
		box.addGame(FontTest.class);
		box.addGame(GeomTest.class);
		box.addGame(GradientTest.class);
		box.addGame(GraphicsTest.class);
		box.addGame(ImageBufferTest.class);
		box.addGame(ImageReadTest.class);
		box.addGame(ImageTest.class);
		box.addGame(KeyRepeatTest.class);
		box.addGame(MusicListenerTest.class);
		box.addGame(PackedSheetTest.class);
		box.addGame(PedigreeTest.class);
		box.addGame(PureFontTest.class);
		box.addGame(ShapeTest.class);
		box.addGame(SoundTest.class);
		box.addGame(SpriteSheetFontTest.class);
		box.addGame(TransparentColorTest.class);
		
		AppGameContainer container = new AppGameContainer(box);
		container.setDisplayMode(800,600,false);
		container.start();
	} catch (SlickException e) {
		e.printStackTrace();
	}
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:40,代碼來源:TestBox.java

示例11: main

import org.newdawn.slick.AppGameContainer; //導入方法依賴的package包/類
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test
 */
public static void main(String[] argv) {
	try {
		AppGameContainer container = new AppGameContainer(new PackedSheetTest());
		container.setDisplayMode(800,600,false);
		container.start();
	} catch (SlickException e) {
		e.printStackTrace();
	}
}
 
開發者ID:IngSW-unipv,項目名稱:Progetto-C,代碼行數:15,代碼來源:PackedSheetTest.java

示例12: main

import org.newdawn.slick.AppGameContainer; //導入方法依賴的package包/類
/**
 * Entry point to our test
 * 
 * @param argv The arguments passed to the test
 */
public static void main(String[] argv) {
	try {
		AppGameContainer container = new AppGameContainer(new TransformTest());
		container.setDisplayMode(640,480,false);
		container.start();
	} catch (SlickException e) {
		e.printStackTrace();
	}
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:15,代碼來源:TransformTest.java

示例13: main

import org.newdawn.slick.AppGameContainer; //導入方法依賴的package包/類
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test
 */
public static void main(String[] argv) {
	try {
		AppGameContainer container = new AppGameContainer(new ImageOutTest());
		container.setDisplayMode(800,600,false);
		container.start();
	} catch (SlickException e) {
		e.printStackTrace();
	}
}
 
開發者ID:IngSW-unipv,項目名稱:Progetto-C,代碼行數:15,代碼來源:ImageOutTest.java

示例14: main

import org.newdawn.slick.AppGameContainer; //導入方法依賴的package包/類
/**
 * Entry point to our simple test
 * 
 * @param argv The arguments passed in
 */
public static void main(String argv[]) {
	try {
		AppGameContainer container = new AppGameContainer(new CurveTest());
		container.setDisplayMode(800,600,false);
		container.start();
	} catch (SlickException e) {
		e.printStackTrace();
	}
}
 
開發者ID:j-dong,項目名稱:trashjam2017,代碼行數:15,代碼來源:CurveTest.java

示例15: main

import org.newdawn.slick.AppGameContainer; //導入方法依賴的package包/類
/**
 * Entry point to our test
 * 
 * @param argv The arguments passed to the test
 */
public static void main(String[] argv) {
	try {
		AppGameContainer container = new AppGameContainer(new ParticleTest());
		container.setDisplayMode(800,600,false);
		container.start();
	} catch (SlickException e) {
		e.printStackTrace();
	}
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:15,代碼來源:ParticleTest.java


注:本文中的org.newdawn.slick.AppGameContainer.setDisplayMode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。