Package com.sertaogames.cactus2d

Examples of com.sertaogames.cactus2d.GameObject.AddComponent()


    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);
   

    l.alignment = HAlignment.CENTER;
    label.AddComponent(l);
View Full Code Here


    GameObject gui = new GameObject("Gui");
    int width = 640;
    int height = 128;
    SpriteRendererComponent sprite = SpriteRendererComponent.getTextureRegion(tx, width, height, 3, 0);

    gui.AddComponent(sprite);
    gui.spriteRenderer.gui = true;
    gui.transform.getLocalPosition().sub(20 * Cactus2DApplication.invCameraZoom, 15  * Cactus2DApplication.invCameraZoom);
   
    GameObject subGameObject = new GameObject("Pause");
    height = 128;
View Full Code Here

   
    GameObject subGameObject = new GameObject("Pause");
    height = 128;
    width = 128;
    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"));
View Full Code Here

    TextureRegion[][] matriz = TextureRegion.split(texture, width, height);
    SpriteRendererComponent sr = new SpriteRendererComponent(texture);
    sr.spriteRegion = matriz[0][0];
    Utils.offsetCorrection(go.transform.getLocalPosition());
   
    go.AddComponent(sr);
    addGameObject(go);
   
    GameObject seismographGO = new GameObject("seismograph");
    texture = Cactus2DApplication.loadTexture("data/textures/gui.png", true);
    width = 512;
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

    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;
    GameObject time = new GameObject("Time");
View Full Code Here

    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;
    GameObject time = new GameObject("Time");
    label = new LabelComponent(" ");
View Full Code Here

    height = 256;
    seismographGO.transform.getPosition().set(300 - width/2, 1024 - height * 1.2f);
    Utils.offsetCorrection(seismographGO.transform.getLocalPosition());
    TextureRegion[][] matriz3 = TextureRegion.split(texture, width, height);
    sr = new SpriteRendererComponent(null,matriz3[2][0]);
    seismographGO.AddComponent(sr);
    addGameObject(seismographGO);
   
    GameObject animatedGO = new GameObject("anim");
    AnimationComponent anim = new AnimationComponent();
    Texture tx  = new Texture(Gdx.files.internal("data/textures/sismoAnim.png"));
View Full Code Here

    LabelComponent label = null;
    GameObject time = new GameObject("Time");
    label = new LabelComponent(" ");
    time.transform.getLocalPosition().add(100* Cactus2DApplication.invCameraZoom, 80* Cactus2DApplication.invCameraZoom);
    label.setFontName(TerremotoApplication.fontName);
    time.AddComponent(label);
    time.AddComponent(new SpriteRendererComponent(null));
    time.spriteRenderer.gui = true;
    gui.addGameObject(time);
   
    GameObject points = new GameObject("Points");
View Full Code Here

    int[] frames = { 0, 1, 2, 3, 4, 5, 6, 7};
    anim.addAnimation("anim", tx, 384, 192, frames, 5, false);
   
    anim.play("anim");
   
    animatedGO.AddComponent(anim);
    animatedGO.AddComponent(new SpriteRendererComponent(null));
    animatedGO.transform.getPosition().add(width/2 - 370/2, height/2 - 215/2);
    seismographGO.addGameObject(animatedGO);
   
    GameObject titleGO = new GameObject("title");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.