Package com.sertaogames.cactus2d.components

Examples of com.sertaogames.cactus2d.components.ButtonComponent


    GameObject subGameObject = new GameObject("Continue");
    subGameObject.transform.getLocalPosition().add(width * 0.7f* Cactus2DApplication.invCameraZoom, 0);
    subGameObject.AddComponent(new SpriteRendererComponent(null));
    subGameObject.spriteRenderer.gui = true;
    TextureRegion[][] tmp = TextureRegion.split(tx, 128, 128);
    subGameObject.AddComponent(new ButtonComponent(tmp[0][0], tmp[0][1]));
    subGameObject.AddComponent(new AudioComponent("data/sound/click.wav"));
    subGameObject.AddComponent(new NextstateComponent(newState));
    if(GameControllerComponent.state != GameState.WON && GameControllerComponent.state != GameState.LOST){
      tip.addGameObject(subGameObject);
    }
   
    subGameObject = new GameObject("Reload");
    subGameObject.transform.getLocalPosition().add(10, 0);
    subGameObject.AddComponent(new SpriteRendererComponent(null));
    subGameObject.spriteRenderer.gui = true;
    subGameObject.AddComponent(new ButtonComponent(tmp[1][0], tmp[1][1]));
    subGameObject.AddComponent(new AudioComponent("data/sound/click.wav"));
    subGameObject.AddComponent(new LevelLoader(MainLevel.class));
    tip.addGameObject(subGameObject);

    subGameObject = new GameObject("Menu");
    subGameObject.transform.getLocalPosition().add(width * 0.35f * Cactus2DApplication.invCameraZoom, 0);
    subGameObject.AddComponent(new SpriteRendererComponent(null));
    subGameObject.spriteRenderer.gui = true;
    subGameObject.AddComponent(new ButtonComponent(tmp[0][6], tmp[0][7]));
    subGameObject.AddComponent(new AudioComponent("data/sound/click.wav"));
    subGameObject.AddComponent(new LevelLoader(MenuLevel.class));
    tip.addGameObject(subGameObject);
   

View Full Code Here


    width = 256;
    height = 128;
    TextureRegion[][] tmp = TextureRegion.split(bt, width, height);
    go.transform.getLocalPosition().add(Gdx.graphics.getWidth()/2 - 128 * Cactus2DApplication.invCameraZoom, Gdx.graphics.getHeight()/2 - 64 * Cactus2DApplication.invCameraZoom);
    go.spriteRenderer.gui = true;
    go.AddComponent(new ButtonComponent(tmp[2][0],tmp[2][1]));
    go.AddComponent(new LevelLoader(MainLevel.class));
    go.AddComponent(new AudioComponent("data/sound/click.wav"));
    addGameObject(go);

    go = new GameObject("sound");
    tmp = TextureRegion.split(bt, 128, 128);
    go.AddComponent(new ButtonComponent(tmp[1][4],tmp[1][5]));
    go.AddComponent(new SpriteRendererComponent(null));
    go.AddComponent(new ToggleButtonComponent(tmp[1][2],tmp[1][3], tmp[1][4],tmp[1][5]));
    addGameObject(go);
   
    Cactus2DApplication.jukeBox.play(0);
View Full Code Here

    subGameObject.transform.getLocalPosition().add(465 * Cactus2DApplication.invCameraZoom, 0);
    subGameObject.AddComponent(new SpriteRendererComponent(null));
    TextureRegion[][] tmp = TextureRegion.split(tx, width, height);
    tmp = TextureRegion.split(tx, width, height);
    subGameObject.spriteRenderer.gui = true;
    subGameObject.AddComponent(new ButtonComponent(tmp[0][2], tmp[0][3]));
    subGameObject.AddComponent(new AudioComponent("data/sound/click.wav"));
    subGameObject.AddComponent(new PauseComponent());
    gui.addGameObject(subGameObject);
   
    LabelComponent label = null;
View Full Code Here

TOP

Related Classes of com.sertaogames.cactus2d.components.ButtonComponent

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.