Skip to content

Commit

Permalink
Specify outline colour
Browse files Browse the repository at this point in the history
  • Loading branch information
ultraq committed Jun 25, 2024
1 parent 98fa42c commit 8ae5c25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import org.joml.primitives.Rectanglef
*/
class Outline extends Primitive {

Outline(Rectanglef bounds) {
Outline(Rectanglef bounds, Colour colour) {

super(MeshType.LINE_LOOP, Colour.RED, bounds as Vector2f[])
super(MeshType.LINE_LOOP, colour, bounds as Vector2f[])
this.bounds.set(bounds)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package nz.net.ultraq.redhorizon.explorer.scripts

import nz.net.ultraq.redhorizon.classic.maps.Map
import nz.net.ultraq.redhorizon.engine.graphics.Colour
import nz.net.ultraq.redhorizon.engine.graphics.Window
import nz.net.ultraq.redhorizon.engine.graphics.imgui.ImGuiLayer.GameWindow
import nz.net.ultraq.redhorizon.engine.input.CursorPositionEvent
Expand Down Expand Up @@ -167,7 +168,7 @@ class MapViewerScript extends Script<Map> {
selectedNode.removeChild { node -> node instanceof Outline }
}

selectedNode = event.node.addChild(new Outline(event.node.bounds))
selectedNode = event.node.addChild(new Outline(event.node.bounds, Colour.RED))
moveCameraTo(
new Vector3f(selectedNode.globalPosition).add(
selectedNode.globalBounds.lengthX() / 2 as float,
Expand Down

0 comments on commit 8ae5c25

Please sign in to comment.