Game Development Community

Render spawnsphere spheres even when not selected ?

by Orion Elenzil · in Torque Game Engine · 04/17/2007 (9:28 am) · 2 replies

Hey all - i feel i should be able to figure this one, but it's early and it's still foggy here in San Francisco.

i'd like to modify SpawnSpheres s.t. when you're in the mission editor,
their sphere is always rendered, not just when you've got the sphere selected.

it seems like some root behaviour in MissionMarker,
but i can't ferret it out.

any hints ?

while i'm at it,
there's also some weirdness around the radius parameter of SpawnSpheres - it seems to only render at integer sizes, altho i suspect the functionality is proper floats. is that stock, or have i broken something ?

tia,
orion

#1
04/17/2007 (11:33 am)
Clint brewer set me up with the answer to this one.
who would have suspected the spawnspheres are rendered from script ?
in common/editor/editorRender.cs
we find the following code:
function SpawnSphere::onEditorRender(%this, %editor, %selected, %expanded)
{
   if(%selected $= "true")
   {
      %editor.consoleFrameColor = "255 0 0";
      %editor.consoleFillColor = "0 15 0 15";
      %editor.renderSphere(%this.getWorldBoxCenter(), %this.radius, 1);
   }
}

which the change to make is obvious,
and i didn't notice any performance hit.

before and after pic:
elenzil.com/gg/images/spheres.png
#2
04/17/2007 (11:38 am)
Hehe, nice catch, took me a while to figure that one out, too ;)