List of usage examples for com.badlogic.gdx.graphics.glutils ShapeRenderer ShapeRenderer
public ShapeRenderer()
From source file:com.github.badoualy.badoualyve.ui.stage.LoadingStage.java
License:Open Source License
public LoadingStage() { shapeRenderer = new ShapeRenderer(); shapeRenderer.setColor(0.8f, 0.8f, 0.8f, 1f); icLoading = gdxUtils().createImageFromTexture(AssetsUtils.IC_LOADING); icLoading.setPosition(getWidth() / 2 - icLoading.getWidth() / 2, getHeight() / 2 - icLoading.getHeight() / 2); icLoading.setOrigin(icLoading.getWidth() / 2, icLoading.getHeight() / 2); addActor(icLoading);//from w w w .j av a 2s . c om }
From source file:com.github.fauu.helix.system.ScreenFadingSystem.java
License:Open Source License
@Override protected void initialize() { this.shapeRenderer = new ShapeRenderer(); }
From source file:com.github.mkjensen.breakall.actor.Box2DActor.java
License:Apache License
protected Box2DActor(World world, float width, float height) { setWidth(width);/*from w w w .j av a 2s . c o m*/ setHeight(height); this.world = world; this.body = setupBody(); this.renderer = new ShapeRenderer(); }
From source file:com.hindelid.demo.pathfindingtest.Main.java
License:Apache License
@Override public void create() { mShapeRenderer = new ShapeRenderer(); mGraph = new TestGraph(20); mPath = new DefaultGraphPath<TestNode>(); mHeuristic = new ManhattanDistanceHeuristic(); // Initialize all the nodes that should be present. int index = 0; //Used to set index for every node. for (int x = 0; x < mMap.length; x++) { for (int y = 0; y < mMap[0].length; y++) { if (mMap[x][y] == 1) { mNodes[x][y] = new TestNode(x * TestNode.TILE_SIZE, y * TestNode.TILE_SIZE, index++); mGraph.addNode(mNodes[x][y]); }/*from w w w .ja v a2 s . c om*/ } } // Add connection to every neighbour of this node. for (int x = 0; x < mNodes.length; x++) { for (int y = 0; y < mNodes[0].length; y++) { if (null != mNodes[x][y]) { addNodeNeighbour(mNodes[x][y], x - 1, y); // Node to left addNodeNeighbour(mNodes[x][y], x + 1, y); // Node to right addNodeNeighbour(mNodes[x][y], x, y - 1); // Node below addNodeNeighbour(mNodes[x][y], x, y + 1); // Node above } } } mPathFinder = new IndexedAStarPathFinder<TestNode>(mGraph, true); calculatePath(); }
From source file:com.hindelid.ld.thirtyfour.HUDDisplay.java
License:Apache License
public HUDDisplay() { mShapeRenderer = new ShapeRenderer(); mBatch = new SpriteBatch(); mFont = new BitmapFont(); mFont.setColor(Color.RED);/* w w w. j a va 2 s . co m*/ mHUDCamera = new OrthographicCamera(); mHUDCamera.position.set(400 / 2, 400 / 2, 0); mHUDCamera.update(); mHUDViewport = new ExtendViewport(400, 400, mHUDCamera); reset(); }
From source file:com.hindelid.ld.thirtyfour.Main.java
License:Apache License
@Override public void create() { mShapeRenderer = new ShapeRenderer(); mHUDDisplay = new HUDDisplay(); mCamera = new OrthographicCamera(); mViewPort = new ExtendViewport(Constants.VIEW_SIZE_X, Constants.VIEW_SIZE_Y, mCamera); mCurrentViewCord = new Vector2(Constants.VIEW_SIZE_X / 2, Constants.VIEW_SIZE_Y / 2); moveAndUpdateCamera();/* w ww . j a v a 2 s . c o m*/ mStartSound = Gdx.audio.newSound(Gdx.files.internal("start.wav")); mDeadSound = Gdx.audio.newSound(Gdx.files.internal("dead.wav")); mOctoSound = Gdx.audio.newSound(Gdx.files.internal("octo.wav")); mFishSound = Gdx.audio.newSound(Gdx.files.internal("fish.wav")); resetGame(); }
From source file:com.hot.ball.hotball.ui.Graphics.java
private Graphics() { this.shapeRenderer = new ShapeRenderer(); this.spriteBatch = new SpriteBatch(); this.font = new BitmapFont(Gdx.files.internal("other/font.fnt")); overlays = new LinkedList<>(); yOffset = (Gdx.graphics.getHeight() - Court.COURT_HEIGHT) / 2; }
From source file:com.hot.ball.hotball.ui.GraphicsBackUp.java
private GraphicsBackUp() { this.shapeRenderer = new ShapeRenderer(); this.spriteBatch = new SpriteBatch(); this.font = new BitmapFont(Gdx.files.internal("other/font.fnt")); overlays = new LinkedList<>(); }
From source file:com.intel.crtl.workload.Box2DDebugRenderer.java
License:Apache License
public Box2DDebugRenderer(boolean drawBodies, boolean drawJoints, boolean drawAABBs, boolean drawInactiveBodies, boolean drawVelocities, boolean drawContacts) { // next we setup the immediate mode renderer renderer = new ShapeRenderer(); // initialize vertices array for (int i = 0; i < vertices.length; i++) vertices[i] = new Vec2(); this.drawBodies = drawBodies; this.drawJoints = drawJoints; this.drawAABBs = drawAABBs; this.drawInactiveBodies = drawInactiveBodies; this.drawVelocities = drawVelocities; this.drawContacts = drawContacts; }
From source file:com.jemge.j2d.Renderer2D.java
License:Apache License
public Renderer2D() { this.RENDERTARGETS = new HashMap<>(); this.CAMERA = new OrthographicCamera(); this.CAMERA.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); this.CAMERAVIEW = new Rectangle(0, 0, this.CAMERA.viewportWidth, this.CAMERA.viewportHeight); this.SPRITEBATCH = new SpriteBatch(); this.SHAPERENDERER = new ShapeRenderer(); this.BACKGROUND = new Background(); this.FRAMEBUFFER = new FrameBuffer(Pixmap.Format.RGB888, Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), false);/*from w w w . j a v a 2 s .c o m*/ debugRenderer = new Box2DDebugRenderer(); this.INPUTMANAGER = Jemge.engine.getInputManager(); this.JUIMANAGER = Jemge.engine.getJUIManager(); this.RENDERTARGETS.put(0, new Layer()); }