Hello, me again.. i try to position a sprite created for head up display over a scene, but can't move the display where i want
here the code i used :
--Get the displays
local displays = GetDisplays()
--Create window
local window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[1])
--Create framebuffer
local framebuffer = CreateFramebuffer(window)
--Create world
local world = CreateWorld()
--env map
local specmap = LoadTexture("./Materials/Environment/Default/specular.dds")
local diffmap = LoadTexture("./Materials/Environment/Default/diffuse.dds")
world:SetEnvironmentMap(specmap, ENVIRONMENTMAP_BACKGROUND)
world:SetEnvironmentMap(specmap, ENVIRONMENTMAP_SPECULAR)
world:SetEnvironmentMap(diffmap, ENVIRONMENTMAP_DIFFUSE)
--[[load map
local mapname = "Maps/scene1.ultra"
local cl = CommandLine()
if type(cl["map"]) == "string" then mapname = cl["map"] end
local scene = LoadMap(world, mapname)
--]]
--Create light
local light = CreateBoxLight(world)
light:SetRange(-10, 10)
light:SetArea(15, 15)
light:SetRotation(45, 35, 0)
light:SetColor(2)
--Load a font
local font = LoadFont("Fonts/arial.ttf")
local fontsize = 36
-- Create sprite
local sprite = CreateSprite(world, font,"HEY YOU !",fontsize)
sprite:SetColor(1, 1, 1, 1)
sprite:SetPosition(0,-50, 0)
-- Create a camera
local camera = CreateCamera(world,PROJECTION_PERSPECTIVE)
camera:SetClearColor(0.125)
camera:SetPosition(0, 5, 0)
--Create second camera
local cam2 = CreateCamera(world,PROJECTION_ORTHOGRAPHIC)
cam2:SetPosition(0, 0, 0)
cam2:SetClearMode(CLEAR_DEPTH)
--Camera controls to look around
require 'Components/Player/CameraControls'
camera:AddComponent(CameraControls)
--main loop
while not window:KeyDown(KEY_ESCAPE) do
world:Update()
world:Render(framebuffer)
end
Thank you for helping