Android Open Source - AndroidShooter Joystick Actor






From Project

Back to project page AndroidShooter.

License

The source code is released under:

GNU General Public License

If you think the Android project AndroidShooter listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package jonathan.geoffroy.shooter.view.actors;
/*ww w.  j  a va  2  s  .  c  o  m*/
import java.util.ArrayList;

import jonathan.geoffroy.shooter.Shooter;

import com.badlogic.gdx.assets.AssetDescriptor;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.Touchpad;
import com.badlogic.gdx.scenes.scene2d.utils.Drawable;

public class JoystickActor extends Touchpad {
  private final static String BACKGROUND = Shooter.IMAGES + "/JoystickActor/background.png", KNOB = Shooter.IMAGES + "/JoystickActor/knob.png";
  private static TouchpadStyle touchpadStyle;
  private static Skin touchpadSkin;

  public JoystickActor() {
    super(10, touchpadStyle);
  }

  @SuppressWarnings({ "rawtypes", "unchecked" })
  public static ArrayList<AssetDescriptor<Object>> getAssetDescriptors() {
    ArrayList<AssetDescriptor<Object>> result = new ArrayList<AssetDescriptor<Object>>();
    result.add(new AssetDescriptor(BACKGROUND, Texture.class));
    result.add(new AssetDescriptor(KNOB, Texture.class));
    return result;
  }

  public static void initialize() {
    touchpadStyle = new TouchpadStyle();
    Texture backgroundText = (Texture) Shooter.getAsset(BACKGROUND);
    Texture knobText = (Texture) Shooter.getAsset(KNOB);

    touchpadSkin = new Skin();
    touchpadSkin.add("background", backgroundText);
    touchpadSkin.add("knob", knobText);
    touchpadStyle = new TouchpadStyle();
    Drawable touchBackground = touchpadSkin.getDrawable("background");
    Drawable touchKnob = touchpadSkin.getDrawable("knob");

    touchpadStyle.background = touchBackground;
    touchpadStyle.knob = touchKnob;
  }
}




Java Source Code List

jonathan.geoffroy.shooter.MainActivity.java
jonathan.geoffroy.shooter.Main.java
jonathan.geoffroy.shooter.Shooter.java
jonathan.geoffroy.shooter.model.Bullet.java
jonathan.geoffroy.shooter.model.Map.java
jonathan.geoffroy.shooter.model.characters.Character.java
jonathan.geoffroy.shooter.model.characters.Coord2F.java
jonathan.geoffroy.shooter.view.actors.CharacterActor.java
jonathan.geoffroy.shooter.view.actors.JoystickActor.java
jonathan.geoffroy.shooter.view.actors.MapActor.java
jonathan.geoffroy.shooter.view.screens.GameScreen.java
jonathan.geoffroy.shooter.view.screens.LevelScreen.java
jonathan.geoffroy.shooter.view.screens.MainMenuScreen.java
jonathan.geoffroy.shooter.view.utils.App.java
jonathan.geoffroy.shooter.view.utils.HelpScreen.java
jonathan.geoffroy.shooter.view.utils.ListActor.java
jonathan.geoffroy.shooter.view.utils.StageScreen.java
jonathan.geoffroy.shooter.view.utils.TableActor.java
jonathan.geoffroy.shooter.view.utils.WallpaperActor.java