RPG user interface

Blitz3D Forums/Blitz3D Programming/RPG user interface

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

You'd be better off using a second camera for your GUI. Position it somewhere away from your game arena, but not too far away from point zero or you'll get floating point inaccuracies.

eg.

Function CreateHudCamera( L_order, x#, y#, z# )
; USAGE:
; Creates a camera to be used for a heads-up display.

; PARAMETERS:
; L_order - This sets the drawing order of the camera. 'L_order' should be a negative number, so that the HUD camera is drawn on top of the main camera graphics. The highest value negative number will be drawn last (eg. The '-2' camera will be drawn after the '-1' camera.). Note that for negative 'L_order' numbers, z-ordering is turned off for this camera as a result, so the polygons being drawn should not overlap.

; x#, y#, z# - Set the camera's absolute world position. The position should set so that the camera and its associated 3D graphic objects do not interfere with any other cameras.

; RETURNS:
; The new HUD camera's entity handle is returned.


	Local L_cam = CreateCamera()
	PositionEntity L_cam, x#, y#, z#, True ; 
	CameraRange L_cam, 0.2, 5.0
	CameraZoom L_cam, 1.6
	EntityOrder L_cam, L_order
	CameraClsMode L_cam, False, True ; This prevents the background graphics from being overwritten by the camera's clearscreen color.
	Return L_cam
End Function

HUD_camera = CreateHudCamera( -1, 0.0, -500.0, 0.0 )




--