Rendering Objects On Canvas
Posted: 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:
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.
- 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.