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
42 return entity;
43 }
44
45 public void render(CombatEngineLayers layer, ViewportAPI viewport) {
46// float x = 0;
47// float y = 0f;
48// float w = 100;
49// float h = 100;
50// Color color = Color.cyan;
51// float a = 0.25f;
52// if (layer == CombatEngineLayers.BELOW_INDICATORS_LAYER) {
53// x = 50;
54// y = 50;
55// w = 100;
56// h = 100;
57// color = Color.cyan;
58// } else if (layer == CombatEngineLayers.BELOW_PHASED_SHIPS_LAYER) {
59// x = -50;
60// y = 120;
61// w = 50;
62// h = 50;
63// color = new Color(150, 150, 0, 255);
64// a = 1f;
65// } else if (layer == CombatEngineLayers.BELOW_SHIPS_LAYER) {
66// x = -100;
67// y = -100;
68// w = 200;
69// h = 200;
70// color = Color.ORANGE;
71// }
72//
73// float alphaMult = viewport.getAlphaMult();
74//
75// GL11.glDisable(GL11.GL_TEXTURE_2D);
76// GL11.glEnable(GL11.GL_BLEND);
77// GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
78//
79//
80// GL11.glColor4ub((byte)color.getRed(),
81// (byte)color.getGreen(),
82// (byte)color.getBlue(),
83// (byte)(color.getAlpha() * alphaMult * a));
84//
85// GL11.glBegin(GL11.GL_QUADS);
86// {
87// GL11.glVertex2f(x, y);
88// GL11.glVertex2f(x, y + h);
89// GL11.glVertex2f(x + w, y + h);
90// GL11.glVertex2f(x + w, y);
91// }
92// GL11.glEnd();
93 }
94
95}
96
97
98