Starsector API
Loading...
Searching...
No Matches
BaseCombatLayeredRenderingPlugin.java
Go to the documentation of this file.
1package com.fs.starfarer.api.combat;
2
3import java.util.EnumSet;
4
6
9
11 super();
12 }
13
17
18
19 public void advance(float amount) {
20 }
21
22 public void cleanup() {
23 }
24
25 public EnumSet<CombatEngineLayers> getActiveLayers() {
26 return EnumSet.of(layer);
27 }
28
29 public float getRenderRadius() {
30 return 100;
31 }
32
34 this.entity = entity;
35 }
36
37 public boolean isExpired() {
38 return false;
39 }
40
41 public void render(CombatEngineLayers layer, ViewportAPI viewport) {
42// float x = 0;
43// float y = 0f;
44// float w = 100;
45// float h = 100;
46// Color color = Color.cyan;
47// float a = 0.25f;
48// if (layer == CombatEngineLayers.BELOW_INDICATORS_LAYER) {
49// x = 50;
50// y = 50;
51// w = 100;
52// h = 100;
53// color = Color.cyan;
54// } else if (layer == CombatEngineLayers.BELOW_PHASED_SHIPS_LAYER) {
55// x = -50;
56// y = 120;
57// w = 50;
58// h = 50;
59// color = new Color(150, 150, 0, 255);
60// a = 1f;
61// } else if (layer == CombatEngineLayers.BELOW_SHIPS_LAYER) {
62// x = -100;
63// y = -100;
64// w = 200;
65// h = 200;
66// color = Color.ORANGE;
67// }
68//
69// float alphaMult = viewport.getAlphaMult();
70//
71// GL11.glDisable(GL11.GL_TEXTURE_2D);
72// GL11.glEnable(GL11.GL_BLEND);
73// GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
74//
75//
76// GL11.glColor4ub((byte)color.getRed(),
77// (byte)color.getGreen(),
78// (byte)color.getBlue(),
79// (byte)(color.getAlpha() * alphaMult * a));
80//
81// GL11.glBegin(GL11.GL_QUADS);
82// {
83// GL11.glVertex2f(x, y);
84// GL11.glVertex2f(x, y + h);
85// GL11.glVertex2f(x + w, y + h);
86// GL11.glVertex2f(x + w, y);
87// }
88// GL11.glEnd();
89 }
90
91}
92
93
94