Rendering Objects On Canvas

The best and quickest support by a group of top-notch editing specialists, guaranteed!

Moderator: Forum Guards

Rendering Objects On Canvas

Postby SimonDenton » Sun Nov 25, 12 2:30 am

Hey all. I am trying to simply have a mesh object displayed on the screen like how 1st person weapons work but within a HUD window. I have a bad or missing expression when trying to spawn the mesh:

Code: Select all
class TestMesh extends AlarmUnit;

var Canvas canvas;
var SummerPlayer PlayerOwner;
var Inventory inventory;

function GoOnScreen()
{

local rotator NewRot;


PlayerOwner = SummerPlayer(GetPlayerPawn());
   Self.SetLocation( PlayerOwner.Location + CalcDrawOffset());
   NewRot = PlayerOwner.ViewRotation;

   Self.setRotation(newRot);
   Canvas.DrawActor(Self, false);
      
}

simulated function vector CalcDrawOffset()
{
local vector DrawOffset, WeaponBob;
DrawOffset = ((0.9/PlayerOwner.FOVAngle * inventory.PlayerViewOffset) >> PlayerOwner.ViewRotation);
DrawOffset += (PlayerOwner.EyeHeight * vect(0,0,1));
      
return DrawOffset;
}
      
   defaultProperties
   {
   ItemName="Testing Mesh"
   }


The window spawns this object and calls the PutOnScreen function but the object spawns in the world and not on the canvas.

Please help. Thanks.
Last edited by SimonDenton on Sun Nov 25, 12 6:18 am, edited 5 times in total.
SimonDenton
Wannabe
 
Posts: 117
Joined: Sun Oct 03, 10 12:06 pm

Postby Poor » Sun Nov 25, 12 3:58 am

It should be Spawn(class'AlarmUnit') not Spawn(class<AlarmUnit>).
Poor
Poster
 
Posts: 190
Joined: Tue Jan 04, 11 7:42 pm

Postby SimonDenton » Sun Nov 25, 12 4:56 am

Thanks Poor! Updated the code. The alarm unit spawns but not on the canvas :/
SimonDenton
Wannabe
 
Posts: 117
Joined: Sun Oct 03, 10 12:06 pm

Postby Poor » Mon Nov 26, 12 2:29 am

You declared a Canvas variable but you didn't assign anything to it. It will be null and you'll get access nones. I don't see what is calling GoOnScreen() either.

It looks like you are trying to have an alarm unit on the players screen. A texture would work better than an actor. But if you are trying actors then you should set all the collision and blocking variables to false so it can move freely.

I believe you have to use a Window to properly use DrawActor. AugmentationDisplayWindow shows how DrawActor is used for the vision aug.
Poor
Poster
 
Posts: 190
Joined: Tue Jan 04, 11 7:42 pm

Postby SimonDenton » Mon Dec 03, 12 11:11 am

Initially I tried textures but rotating GUI in UE1 is impossible. So I thought "How about rendering a rotating actor?". Thanks for the help. I was trying to use the same method weapons use to render animated/moving actors on the screen so I can have rotating UI at some point.
SimonDenton
Wannabe
 
Posts: 117
Joined: Sun Oct 03, 10 12:06 pm


Return to Editing issues

Who is online

Users browsing this forum: No registered users and 8 guests