public ScreenExtensions(GameManager gameManager) { this.gameManager = gameManager; manager = ManagerAssets.getInstance(); addExtensions = this; camera = new PerspectiveCamera(40, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); camera.position.set(0, 0, Gdx.graphics.getHeight() * 0.183f);//initial 180 camera.lookAt(0, 0, 0); camera.far = 2500; camera.near = 1; camera.update(); controller = new CameraInputController(camera); cam = new OrthographicCamera(); batchsprite = new SpriteBatch(); renderer = new ImmediateModeRenderer20(false, true, 1); gd = new GestureDetector(this); }
public CombatFitght(ScreenCombat screen,float pos) { cy = pos; managerAssets = ManagerAssets.getInstance(); informationProfile = InformationProfile.getInstance(); informationEnklave = InformationEnklave.getInstance(); screenCombat = screen; lookup = managerAssets.getAssetsCombat().getTexture(NameFiles.progressbarcircular); lookup.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear); // groupturret1 = maketurret(180); // groupturret1.setPosition(0,pos * -0.33f); // groupturret2 = maketurret(-60); // groupturret2.setPosition(pos*0.33f,pos *0.26f); // groupturret3 = maketurret(60); // groupturret3.setPosition(-pos*0.33f,pos*0.26f); groupShield = makeShieldEnklave(); groupButtonAction = makeButtonAction(); renderer = new ImmediateModeRenderer20(false,true,1); informationEnklave.selectTargetEnklave = -1; }
public ScreenRooms(GameManager gameManager) { this.gameManager = gameManager; manager = ManagerAssets.getInstance(); camera = new PerspectiveCamera(40, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); camera.position.set(0, 0, Gdx.graphics.getHeight()*0.183f);//initial 180 camera.lookAt(0, 0, 0); camera.far = 2500; camera.near = 1; camera.update(); cam = new OrthographicCamera(); renderer = new ImmediateModeRenderer20(false, true, 1); }
public GLRenderer(final Camera camera) { Validate.notNull(camera); this.camera = camera; ImmediateModeRenderer20 _immediateModeRenderer20 = new ImmediateModeRenderer20(50000, false, true, 0); this.immediateModeRenderer = _immediateModeRenderer20; SpriteBatch _spriteBatch = new SpriteBatch(); this.spriteBatch = _spriteBatch; ComponentLookup _instance = ComponentLookup.getInstance(); AssetManager _component = _instance.<AssetManager>getComponent(AssetManager.class); BitmapFont _smallFont = _component.getSmallFont(); this.font = _smallFont; }
public ImmediateModeRenderer20 dispose() { ImmediateModeRenderer20 _xblockexpression = null; { this.immediateModeRenderer.dispose(); _xblockexpression = this.immediateModeRenderer = null; } return _xblockexpression; }
@Override public void create () { renderer = new ImmediateModeRenderer20(false, false, 0); spriteBatch = new SpriteBatch(); obj = new Sprite(new Texture(Gdx.files.internal("data/badlogicsmall.jpg"))); obj.setSize(40, 40); obj.setOriginCenter(); obj2 = new Sprite(new Texture(Gdx.files.internal("data/bobrgb888-32x32.png"))); obj2.setSize(40, 40); obj2.setOriginCenter(); ZIGZAG_SCALE = Gdx.graphics.getDensity() * 96; // 96DP float w = Gdx.graphics.getWidth() - obj.getWidth(); float h = Gdx.graphics.getHeight() - obj.getHeight(); paths.add(new Bezier<Vector2>(new Vector2(0, 0), new Vector2(w, h))); paths.add(new Bezier<Vector2>(new Vector2(0, 0), new Vector2(0, h), new Vector2(w, h))); paths.add(new Bezier<Vector2>(new Vector2(0, 0), new Vector2(w, 0), new Vector2(0, h), new Vector2(w, h))); Vector2 cp[] = new Vector2[] {new Vector2(0, 0), new Vector2(w * 0.25f, h * 0.5f), new Vector2(0, h), new Vector2(w * 0.5f, h * 0.75f), new Vector2(w, h), new Vector2(w * 0.75f, h * 0.5f), new Vector2(w, 0), new Vector2(w * 0.5f, h * 0.25f)}; paths.add(new BSpline<Vector2>(cp, 3, true)); paths.add(new CatmullRomSpline<Vector2>(cp, true)); pathLength = paths.get(currentPath).approxLength(500); avg_speed = speed * pathLength; Gdx.input.setInputProcessor(this); }
private void createWorld() { dropRadius = 0.1f + dropRadiusK; dropRadiusPixel = (int) (dropRadius * PARTICLE_SIZE); dropRadiusPixel2 = dropRadiusPixel * dropRadiusPixel; if (IS_DESKTOP) { // dropTexture = new Texture("data/fluid_drop_red_64.png"); dropTexture = new Texture("data/fluid_drop_64.png"); dropTexture2 = new Texture("data/fluid_drop_blue_64.png"); dropSprite = new Sprite(dropTexture); dropSprite.setSize(dropRadiusPixel, dropRadiusPixel); } if (IS_DESKTOP) { disposableParticles = new ArrayList<Particle>(SIZE); } defaultShader = new ShaderProgram(Gdx.files.internal("data/shaders/default.vert").readString(), Gdx.files.internal("data/shaders/default.frag").readString()); if (!defaultShader.isCompiled()) { Gdx.app.log("SHADER_LOG", "couldn't compile scene shader: " + defaultShader.getLog()); } immediateRenderer = new ImmediateModeRenderer20(50000, false, true, 0); // On Android populate directly if (!IS_DESKTOP) { for (float j = INITIAL_HEIGHT + hpadding + 2; j < WORLD_HEIGHT - 2; j += 1.0f) { for (float i = -WORLD_WIDTH / 3; i < WORLD_WIDTH / 3; i += 1.0f) { particles.add(new Particle(i, j)); tempParticle = particles.get(particles.size() - 1); tempParticle.type = (emitType); if (particles.size() >= ANDROID_SIZE) return; } } } }
public FluidSimulatorGeneric(FluidSimulatorStarter fluidSimulatorStarter) { this.game = fluidSimulatorStarter; // LibGDX single batches cannot have a size more than 5460 batch = new SpriteBatch(IS_DESKTOP ? 5460 : ANDROID_SIZE); font = new BitmapFont(); camera = new OrthographicCamera(WORLD_WIDTH, WORLD_HEIGHT); camera.position.set(0, (WORLD_HEIGHT / 2) - 1, 0); immediateRenderer = new ImmediateModeRenderer20(SIZE*6, false, true, 0); irt = new Renderer20(SIZE*6, false, true, 1); irt2 = new ImmediateModeRenderer20(SIZE*11, false, true, 1); shapeRenderer = new ShapeRenderer(SIZE); renderer = new Box2DDebugRenderer(true, true, false, true, false, false); //3D camera3D = new PerspectiveCamera(67, WORLD_WIDTH, WORLD_HEIGHT); camera3D.position.set(0, 130f, 250f); camera3D.lookAt(0,150f,0); camera3D.near = 0.1f; camera3D.far = 500f; camera3D.update(); ModelBuilder modelBuilder = new ModelBuilder(); // model = modelBuilder.createSphere(5f, 5f, 5f, 4, 4, GL10.GL_TRIANGLES, // new Material(ColorAttribute.createDiffuse(Color.GREEN)), // Usage.Position | Usage.Normal); model = modelBuilder.createBox(5f, 5f, 5f, new Material(ColorAttribute.createDiffuse(Color.GREEN)), Usage.Position | Usage.Normal); instance = new ModelInstance(model); modelBatch = new ModelBatch(); environment = new Environment(); environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.4f, 0.4f, 0.4f, 1f)); environment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, 0, -0.8f, -0.2f)); camController = new Camera3DController(camera3D); camController.setFluidSimulator(this); world = new World(new Vector2(0, -9.8f), false); world.setContactListener(this); }
@Override public void create() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { e.printStackTrace(); } stage = new Stage(new ScreenViewport()); fontBatch = new SpriteBatch(); font = new BitmapFont(); assets = new AssetManager(); assets.load("img/gui/knob.png", Texture.class); assets.finishLoading(); skin = new Skin(Gdx.files.internal("skin/default/uiskin.json")); skin.add("knob", assets.get("img/gui/knob.png", Texture.class)); knobs = new Image[4]; renderer = new ImmediateModeRenderer20(false, false, 0); Vector2[] v = new Vector2[4]; Vector2[] w = new Vector2[4]; for (int i = 0; i < knobs.length; i++) { knobs[i] = new Image(skin.getDrawable("knob")); knobs[i].setPosition(startPos[i].x, startPos[i].y); stage.addActor(knobs[i]); v[i] = new Vector2(startPos[i].x, startPos[i].y); w[i] = new Vector2((startPos[i].x - X) / SIZE, (startPos[i].y - X) / SIZE); } bezier = new Bezier<Vector2>(v); bezierLogic = new Bezier<Vector2>(w); stage.addListener(this); stage.getCamera().rotate(Vector3.Z, -270); Gdx.input.setInputProcessor(stage); }
public ShapeRenderer (int maxVertices) { renderer = new ImmediateModeRenderer20(maxVertices, false, true, 0); projView.setToOrtho2D(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); matrixDirty = true; }
@Override public void create () { renderer = new ImmediateModeRenderer20(false, true, 1); texture = new Texture(Gdx.files.internal("data/badlogic.jpg")); }
public SwipeTriStrip() { gl20 = new ImmediateModeRenderer20(false, true, 1); }
public DebugGeometryRenderer() { renderer = new ImmediateModeRenderer20(5000, false, true, 0, new DebugShader()); }