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


Java Skin.add方法代碼示例

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


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

示例1: createToolTip

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //導入方法依賴的package包/類
private void createToolTip()
{
	Skin skin = new Skin();
	Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
	pixmap.setColor(Color.WHITE);
	pixmap.fill();
	skin.add("white", new Texture(pixmap));
	skin.add("default", new BitmapFont());

	TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
	textButtonStyle.up = skin.newDrawable("white", new Color(0, 0, 0, 1));
	textButtonStyle.font = skin.getFont("default");
	skin.add("default", textButtonStyle);

	labelToolTip = new TextButton("TEST", skin);
	labelToolTip.setX(5);
	labelToolTip.setY(5);
	labelToolTip.setWidth(125);
	labelToolTip.setVisible(false);
	labelToolTip.getLabel().setWrap(true);
	labelToolTip.setHeight(labelToolTip.getLabel().getHeight());
	group.addActor(labelToolTip);
}
 
開發者ID:MartensCedric,項目名稱:LD38-Compo,代碼行數:24,代碼來源:LudumDare38.java

示例2: createResetButton

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //導入方法依賴的package包/類
private void createResetButton()
{
	Skin skin = new Skin();
	Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
	pixmap.setColor(Color.WHITE);
	pixmap.fill();
	skin.add("white", new Texture(pixmap));
	skin.add("default", new BitmapFont());

	TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
	textButtonStyle.up = skin.newDrawable("white", new Color(0, 0, 0, 1));
	textButtonStyle.font = skin.getFont("default");
	skin.add("default", textButtonStyle);

	btnReset = new TextButton("RESET", skin);
	btnReset.setX(5);
	btnReset.setY(Gdx.graphics.getHeight() - 25);
	btnReset.setWidth(60);
	btnReset.setVisible(true);
	group.addActor(btnReset);
}
 
開發者ID:MartensCedric,項目名稱:LD38-Compo,代碼行數:22,代碼來源:LudumDare38.java

示例3: createUndoButton

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //導入方法依賴的package包/類
private void createUndoButton()
{
	Skin skin = new Skin();
	Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
	pixmap.setColor(Color.WHITE);
	pixmap.fill();
	skin.add("white", new Texture(pixmap));
	skin.add("default", new BitmapFont());

	TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
	textButtonStyle.up = skin.newDrawable("white", new Color(0, 0, 0, 1));
	textButtonStyle.font = skin.getFont("default");
	skin.add("default", textButtonStyle);

	btnUndo = new TextButton("UNDO", skin);
	btnUndo.setX(70);
	btnUndo.setY(Gdx.graphics.getHeight() - 25);
	btnUndo.setWidth(60);
	btnUndo.setVisible(true);
	group.addActor(btnUndo);
}
 
開發者ID:MartensCedric,項目名稱:LD38-Compo,代碼行數:22,代碼來源:LudumDare38.java

示例4: updateVisual

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //導入方法依賴的package包/類
public void updateVisual(){
    Skin skin = new Skin();
    Pixmap pixmap = new Pixmap(1,(int)(Gdx.graphics.getHeight()*0.0175), Pixmap.Format.RGBA8888);
    switch (infoProfile.getDateUserGame().getFaction()){
        case 1:{
            pixmap.setColor(1, 0f, 0f, 1);
            break;
        }
        case 2:{
            pixmap.setColor(0f, 0.831f, 0.969f,1f);
            break;
        }
        case 3:{
            pixmap.setColor(0.129f, 0.996f, 0.29f,1);
            break;
        }
    }
    pixmap.fill();
    skin.add("blue", new Texture(pixmap));
    ProgressBar.ProgressBarStyle style = new ProgressBar.ProgressBarStyle(bar.getStyle().background,skin.newDrawable("blue",Color.WHITE));
    style.knobBefore = style.knob;
    bar.setStyle(style);
}
 
開發者ID:TudorRosca,項目名稱:enklave,代碼行數:24,代碼來源:ProgressBarEnergy.java

示例5: loadSkin

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //導入方法依賴的package包/類
static Skin loadSkin() {
    String folder = "ui/x" + bestMultiplier + "/";

    // Base skin
    Skin skin = new Skin(Gdx.files.internal("skin/uiskin.json"));

    // Nine patches
    final int border = (int)(28 * bestMultiplier);
    skin.add("button_up", new NinePatch(new Texture(
            Gdx.files.internal(folder + "button_up.png")), border, border, border, border));

    skin.add("button_down", new NinePatch(new Texture(
            Gdx.files.internal(folder + "button_down.png")), border, border, border, border));

    for (String id : ids) {
        skin.add(id + "_texture", new Texture(Gdx.files.internal(folder + id + ".png")));
    }

    folder = "font/x" + bestMultiplier + "/";
    skin.add("font", new BitmapFont(Gdx.files.internal(folder + "geosans-light64.fnt")));
    skin.add("font_small", new BitmapFont(Gdx.files.internal(folder + "geosans-light32.fnt")));
    skin.add("font_bonus", new BitmapFont(Gdx.files.internal(folder + "the-next-font.fnt")));

    return skin;
}
 
開發者ID:LonamiWebs,項目名稱:Klooni1010,代碼行數:26,代碼來源:SkinLoader.java

示例6: initTouchpad

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //導入方法依賴的package包/類
private void initTouchpad() {
        // TODO: use uiskin.json
//        Skin touchpadSkin = new Skin(Gdx.files.internal("data/uiskin.json"));
        Skin touchpadSkin = new Skin();
        touchpadSkin.add("touchBackground", assetService.getTexture(TOUCH_BACKGROUND));
        touchpadSkin.add("touchKnob", assetService.getTexture(TOUCH_KNOB));
        Touchpad.TouchpadStyle style = new Touchpad.TouchpadStyle();

        style.background = touchpadSkin.getDrawable("touchBackground");
        style.knob = touchpadSkin.getDrawable("touchKnob");
        style.knob.setMinHeight(TOUCHPAD_SIZE / 2);
        style.knob.setMinWidth(TOUCHPAD_SIZE / 2);

        touchPad = new Touchpad(15, style);
        touchPad.setBounds(TOUCHPAD_MARGIN, TOUCHPAD_MARGIN, TOUCHPAD_SIZE, TOUCHPAD_SIZE);

        addListener(new ClickListener() {
            @Override
            public void clicked(InputEvent event, float x, float y) {
                super.clicked(event, x, y);
            }
        });
        NoClickZone padZone = new NoClickZone(touchPad, NO_CLICK_MARGIN);
        addActor(padZone);

        touchpadSkin.add("touchButton", assetService.getTexture(TOUCH_KNOB));
        button = new GamepadButton(touchpadSkin.getDrawable("touchButton"));
        button.setSize(BUTTON_SIZE, BUTTON_SIZE);
        NoClickZone buttonZone = new NoClickZone(button, NO_CLICK_MARGIN);
        addActor(buttonZone);
    }
 
開發者ID:ezet,項目名稱:penguins-in-space,代碼行數:32,代碼來源:GamepadController.java

示例7: initTouchPad

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //導入方法依賴的package包/類
private void initTouchPad() {
	touchpadSkin = new Skin();
	touchpadSkin.add("touchBackground", GameUtils.getGame().assetHandler.get("Controls/touchBackground.png",Texture.class));
	touchpadSkin.add("touchKnob", GameUtils.getGame().assetHandler.get("Controls/touchKnob.png",Texture.class));
	touchpadStyle = new TouchpadStyle();
	touchBackground = touchpadSkin.getDrawable("touchBackground");
	touchKnob = touchpadSkin.getDrawable("touchKnob");
	touchpadStyle.background = touchBackground;
	touchpadStyle.knob = touchKnob;
	touchpad = new Touchpad(10, touchpadStyle);
	touchpad.setBounds(15, 15, 200, 200);
	
}
 
開發者ID:Arcxes,項目名稱:CursedEcho,代碼行數:14,代碼來源:CursedEchoController.java

示例8: IntroScreen

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //導入方法依賴的package包/類
IntroScreen(final ParticleGame game) {
    particle_game = game;
    stage = new Stage();
    table = new Table();

    table.setFillParent(true);
    table.setDebug(true);
    stage.addActor(table);

    Skin skin = new Skin();
    
    Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
    pixmap.setColor(Color.WHITE);
    pixmap.fill();
    
    skin.add("white", new Texture(pixmap));
    skin.add("font", game.getFont());

    TextButton.TextButtonStyle text_button_style = new TextButton.TextButtonStyle();
    final Color button_color = new Color(226 / 255f, 226 / 255f, 226 / 255f, 1f);
    final Color hover_color = new Color(162 / 255f, 162 / 255f, 162 / 255f, 1f);
    text_button_style.up = skin.newDrawable("white", button_color);
    text_button_style.down = skin.newDrawable("white", button_color);
    text_button_style.over = skin.newDrawable("white", hover_color);
    text_button_style.font = skin.getFont("font");
    skin.add("default", text_button_style);

    TextButton play_button = new TextButton("play", skin);
    play_button.addListener(new ChangeListener() {
        @Override
        public void changed(ChangeEvent event, Actor actor) {
            particle_game.setScreen(particle_game.getGameSetupScreen());
        }
    });
    table.add(play_button);
}
 
開發者ID:treeman1111,項目名稱:Particles,代碼行數:37,代碼來源:IntroScreen.java

示例9: ParticleChoiceScreen

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //導入方法依賴的package包/類
ParticleChoiceScreen(final ParticleGame p, final GameScreen g) {
    game = p;
    game_screen = g;

    camera = new OrthographicCamera(PARTICLE_BOARD_W, PARTICLE_BOARD_W);
    camera.position.set(PARTICLE_BOARD_W / 2, PARTICLE_BOARD_W / 2, 0);
    camera.update();

    initStage();
    initTable();

    Skin skin = new Skin();

    Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
    pixmap.setColor(Color.WHITE);
    pixmap.fill();
    skin.add("white", new Texture(pixmap));
    skin.add("default", game.getFont());

    TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
    final Color buttonColor = new Color(226 / 255f, 226 / 255f, 226 / 255f, 1f);
    final Color hoverColor = new Color(162 / 255f, 162 / 255f, 162 / 255f, 1f);
    textButtonStyle.up = skin.newDrawable("white", buttonColor);
    textButtonStyle.down = skin.newDrawable("white", buttonColor);
    textButtonStyle.over = skin.newDrawable("white", hoverColor);
    textButtonStyle.font = skin.getFont("default");
    skin.add("default", textButtonStyle);

    Label.LabelStyle labelStyle = new Label.LabelStyle();
    labelStyle.font = game.getFont();
    labelStyle.fontColor = Color.WHITE;
    skin.add("default", labelStyle);

    // initTableContents(skin);
}
 
開發者ID:treeman1111,項目名稱:Particles,代碼行數:36,代碼來源:ParticleChoiceScreen.java

示例10: createSkin

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //導入方法依賴的package包/類
private Skin createSkin() {
    Skin returnValue = new Skin();
    
    returnValue.add("bg", createDrawable(20, 20, Color.DARK_GRAY), Drawable.class);
    returnValue.add("progress-bar-back", createDrawable(20, 20, Color.BLACK), Drawable.class);
    returnValue.add("progress-bar", createDrawable(1, 20, Color.BLUE), Drawable.class);
    
    ProgressBarStyle progressBarStyle = new ProgressBarStyle();
    progressBarStyle.background = returnValue.getDrawable("progress-bar-back");
    progressBarStyle.knobBefore = returnValue.getDrawable("progress-bar");
    
    returnValue.add("default-horizontal", progressBarStyle);
    
    return returnValue;
}
 
開發者ID:raeleus,項目名稱:bobbybird,代碼行數:16,代碼來源:LoadingState.java

示例11: createSkin

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //導入方法依賴的package包/類
public static void createSkin(){
    
    
    fontHemi10 = createFont(10 , Fonts.HEMI_HEAD);
    fontHemi12 = createFont(12 , Fonts.HEMI_HEAD);
    fontHemi16 = createFont(16 , Fonts.HEMI_HEAD);
    fontHemi18 = createFont(18, Fonts.HEMI_HEAD);
    
    fontVeraRg10 = createFont(10 , Fonts.VERA);
    fontVeraBd16 = createFont(16, Fonts.VERA_BD);
    fontHemi20 = createFont(20,Fonts.HEMI_HEAD);
    fontVeraRg20 = createFont(20, Fonts.VERA);
    fontVeraBd20 = createFont(20, Fonts.VERA_BD);
    fontHemi24 = createFont(24 ,Fonts.HEMI_HEAD);
    fontVeraRg24 = createFont(24, Fonts.VERA);
    fontVeraBd24 = createFont(24, Fonts.VERA_BD);
    Skin skin = new Skin();
    TextureAtlas atlas = new TextureAtlas("interface/ui/atlas-ui.txt");
    skin.addRegions(atlas);
    
    skin.add("fontVeraRg10", Assets.fontVeraRg10);
    skin.add("fontHemi10", Assets.fontHemi10);
    skin.add("fontHemi12", Assets.fontHemi12);
    skin.add("default-font", Assets.fontHemi16);
    skin.add("fontVeraBd16", Assets.fontVeraBd16);
    skin.add("fontHemi18", Assets.fontHemi18);
    skin.add("fontHemi20", Assets.fontHemi20);
    skin.add("fontVeraBd20", Assets.fontVeraBd20);
    skin.add("fontVeraRg20", fontVeraRg20);
    skin.add("fontHemi24", Assets.fontHemi24);
    skin.add("fontVeraRg24", Assets.fontVeraRg24);
    skin.add("fontVeraBd24", Assets.fontVeraBd24);
    skin.load(Gdx.files.internal("interface/ui/uiSkin.json"));
    _skin = skin;
}
 
開發者ID:JoakimRW,項目名稱:ExamensArbeteTD,代碼行數:36,代碼來源:Assets.java

示例12: touchPadConf

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //導入方法依賴的package包/類
public void touchPadConf() {
    touchpadSkin = new Skin();
    touchpadSkin.add("touchpadBackground", new Texture("touchpadBackground.png"));
    touchpadSkin.add("touchKnob", new Texture("touchKnob.png"));
    touchpadStyle = new Touchpad.TouchpadStyle();
    touchpadBackground = touchpadSkin.getDrawable("touchpadBackground");
    touchpadKnob = touchpadSkin.getDrawable("touchKnob");

    touchpadStyle.background = touchpadBackground;
    touchpadStyle.knob = touchpadKnob;

    touchpad = new Touchpad(20, touchpadStyle);
    touchpad.setBounds(15, 15 ,150, 150);

}
 
開發者ID:MSLacerda,項目名稱:DarkDay,代碼行數:16,代碼來源:TouchPadConf.java

示例13: DrawOneAttachers

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //導入方法依賴的package包/類
private Group DrawOneAttachers(String typeFrame, String name, Color type, String photo, float energy,float energymax) {
    Group gr = new Group();
    Texture txt = managerAssets.getAssetsCombat().getTexture(typeFrame);
    Vector2 crop = Scaling.fit.apply(txt.getWidth(),txt.getHeight(),WIDTH,HEIGHT);
    final Image frame = new Image(new TextureRegion(txt));
    frame.setName("frame");
    frame.setSize(crop.x * 0.18f, crop.y * 0.2f);
    frame.setPosition(WIDTH - frame.getWidth() * 1.13f, HEIGHT / 2.3f);
    gr.addActor(frame);
    if(InformationProfile.getInstance().getDateUserGame().getFaction() != InformationEnklave.getInstance().getFaction())
        txt = managerAssets.getAssetsCombat().getTexture(NameFiles.targetRecharge);
    else
        txt = managerAssets.getAssetsCombat().getTexture(NameFiles.target);
    crop = Scaling.fit.apply(txt.getWidth(), txt.getHeight(), WIDTH, HEIGHT);
    Image frameselect = new Image(new TextureRegion(txt));
    frameselect.setSize(crop.x * 0.18f, crop.y * 0.2f);
    frameselect.setName("frameselect");
    frameselect.toFront();
    frameselect.setPosition(WIDTH - frame.getWidth() * 1.13f, HEIGHT / 2.3f);
    frameselect.setVisible(false);
    gr.addActor(frameselect);
    Label labelName = new Label(name.substring(0,name.length()>9 ? 9 : name.length()), new Label.LabelStyle(bt, type));
    labelName.setAlignment(Align.center);
    labelName.setWidth(crop.x*0.18f);
    labelName.setPosition(frame.getX(), frame.getY() + frame.getHeight() * 0.25f);
    gr.addActor(labelName);
    txt = managerAssets.getAssetsCombat().getTexture(photo);
    crop = Scaling.fit.apply(txt.getWidth(), txt.getHeight(), WIDTH, HEIGHT);
    Image profile = new Image(new TextureRegion(txt));
    profile.setColor(type);
    profile.setSize(crop.x * 0.07f, crop.y * 0.07f);
    profile.setPosition(frame.getRight() - frame.getWidth() / 2 - profile.getWidth() / 2, frame.getY() + frame.getHeight() * 0.42f);
    gr.addActor(profile);
    Skin skin = new Skin();
    skin.add("white", new TextureRegion(managerAssets.getAssetsCombat().getTexture(NameFiles.barLifeWhite), 0, 0, (int) (WIDTH * 0.014), (int) (WIDTH * 0.014)));
    ProgressBar.ProgressBarStyle barStyle = new ProgressBar.ProgressBarStyle(skin.newDrawable("white", Color.WHITE), skin.newDrawable("white", type));
    barStyle.knobBefore = barStyle.knob;
    ProgressBar bar = new ProgressBar(0,energymax, 1, false, barStyle);
    bar.setSize(WIDTH * 0.14f,HEIGHT * 0.012f);
    bar.setPosition(frame.getX() + frame.getWidth() * 0.07f, frame.getY() + frame.getHeight() * 0.07f);
    bar.setValue(energy);
    gr.addActor(bar);
    return gr;
}
 
開發者ID:TudorRosca,項目名稱:enklave,代碼行數:45,代碼來源:DrawAttachers.java

示例14: drawoneDefenders

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //導入方法依賴的package包/類
private Group drawoneDefenders(String typeFrame,String name,Color type,String photo,float energy,float energymax){
        Group gr = new Group();
        Texture txt = managerAssets.getAssetsCombat().getTexture(typeFrame);
        Vector2 crop = Scaling.fit.apply(txt.getWidth(), txt.getHeight(), WIDTH, HEIGHT);
        Image frame = new Image(new TextureRegion(txt));
        frame.setName("frame");
        frame.setSize(crop.x * 0.18f, crop.y * 0.2f);
        frame.setPosition(WIDTH * 0.025f, HEIGHT / 2.3f);
        gr.addActor(frame);
        if(InformationProfile.getInstance().getDateUserGame().getFaction() == InformationEnklave.getInstance().getFaction())
            txt = managerAssets.getAssetsCombat().getTexture(NameFiles.targetRecharge);
        else
            txt = managerAssets.getAssetsCombat().getTexture(NameFiles.target);
        crop = Scaling.fit.apply(txt.getWidth(), txt.getHeight(), WIDTH, HEIGHT);
        Image frameselect = new Image(new TextureRegion(txt));
        frameselect.setName("frameselect");
        frameselect.toFront();
        frameselect.setSize(crop.x * 0.18f, crop.y * 0.2f);
        frameselect.setPosition(WIDTH * 0.025f, HEIGHT / 2.3f);
        frameselect.setVisible(false);
        gr.addActor(frameselect);
        Label labelName = new Label(name.substring(0,name.length()>9 ? 9 : name.length()),new Label.LabelStyle(bt,type));
        labelName.setAlignment(Align.center);
        labelName.setSize(WIDTH * 0.18f, HEIGHT * 0.02f);
        labelName.setPosition(frame.getX(), frame.getY() + frame.getHeight() * 0.25f);
        gr.addActor(labelName);
        txt = managerAssets.getAssetsCombat().getTexture(photo);
        crop = Scaling.fit.apply(txt.getWidth(), txt.getHeight(), WIDTH, HEIGHT);
        Image profile = new Image(new TextureRegion(txt));
//        profile.setColor(Color.BLUE);
        profile.setSize(crop.x*0.07f, crop.y*0.07f);
        profile.setPosition(frame.getRight() - frame.getWidth() / 2 - profile.getWidth() / 2, frame.getY() + frame.getHeight() * 0.42f);
        gr.addActor(profile);
        Skin skin = new Skin();
        skin.add("white", new TextureRegion(managerAssets.getAssetsCombat().getTexture(NameFiles.barLifeWhite),0,0,(int)(WIDTH*0.004),(int)(WIDTH*0.014)));
        ProgressBar.ProgressBarStyle barStyle = new ProgressBar.ProgressBarStyle(skin.newDrawable("white", Color.WHITE), skin.newDrawable("white",type));
        barStyle.knobBefore = barStyle.knob;
        ProgressBar bar = new ProgressBar(0, energymax, 1, false, barStyle);
        bar.setSize(WIDTH * 0.14f, HEIGHT * 0.012f);
        bar.setPosition(frame.getX()+frame.getWidth()*0.1f, frame.getY()+frame.getHeight()*0.07f);
        bar.setValue(energy);
        gr.addActor(bar);
        return gr;
    }
 
開發者ID:TudorRosca,項目名稱:enklave,代碼行數:45,代碼來源:DrawDefenders.java

示例15: GameSetupScreen

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //導入方法依賴的package包/類
GameSetupScreen(ParticleGame game) {
    particle_game = game;
    stage = new Stage();
    table = new Table();

    table.setDebug(true);
    table.setFillParent(true);
    stage.addActor(table);

    Skin skin = new Skin();

    Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
    pixmap.setColor(Color.WHITE);
    pixmap.fill();

    skin.add("white", new Texture(pixmap));
    skin.add("font", game.getFont());

    TextButton.TextButtonStyle text_button_style = new TextButton.TextButtonStyle();
    final Color button_color = new Color(226 / 255f, 226 / 255f, 226 / 255f, 1f);
    final Color hover_color = new Color(162 / 255f, 162 / 255f, 162 / 255f, 1f);
    text_button_style.up = skin.newDrawable("white", button_color);
    text_button_style.down = skin.newDrawable("white", button_color);
    text_button_style.over = skin.newDrawable("white", hover_color);
    text_button_style.font = skin.getFont("font");
    skin.add("default", text_button_style);

    TextButton create_game_button = new TextButton("create game!", skin);
    create_game_button.addListener(new ChangeListener() {
        @Override
        public void changed(ChangeEvent event, Actor actor) {
            final int num_boards = 10;
            final PlayerCamera player_camera = new PlayerCamera(PARTICLE_BOARD_W, PARTICLE_BOARD_W,
                PARTICLE_BOARD_W * num_boards
            );
            final DisplayManager display_manager = new DisplayManager(particle_game.getBatch(), player_camera);
            final PropertyDictionary property_dictionary = new PropertyDictionary(10, 10, 10, 10);
            final ParticleSystem particle_system = new ParticleSystem(PARTICLE_BOARD_W, num_boards);
            final VelocitySystem velocity_system = new VelocitySystem(PARTICLE_BOARD_W / 9);
            final WorldGenerator world_generator = new WorldGenerator(
                    11, 25, PARTICLE_BOARD_W * num_boards
            );

            particle_game.setCamera(player_camera);
            particle_game.setDisplayManager(display_manager);
            particle_game.setPropertyDictionary(property_dictionary);
            particle_game.setParticleSystem(particle_system);
            particle_game.setVelocitySystem(velocity_system);

            world_generator.generate(property_dictionary, particle_system);
            final Player player = new Player(particle_game, 0, 50);
            particle_game.setPlayer(player);

            particle_game.setScreen(particle_game.getGameScreen());
        }
    });
    table.add(create_game_button);
}
 
開發者ID:treeman1111,項目名稱:Particles,代碼行數:59,代碼來源:GameSetupScreen.java


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