What I did was to try to understand the system and create my own script, so I can learn a little bit about the subject.
This is only a prototype.
--##################################################
--# Proytecto : Astrocuco
--# Scripter : Yue Rexie.
--# Sitio Web : https://www.iris3dgames.xyz
--# Fichero : Hud.lua
--##################################################
--# Notas : Script enganchado a la entidad
--# MiniMap.
--################################################
Script.map = nil --entity "Map Mesh"
function Script:Start()
self.entity:SetProjectionMode(Camera.Orthographic)
self.texture = Texture:Create(256,256)
self.mtl = Material:Create()
self.mtl:SetShader("Shaders/Model/Diffuse.shader")
self.mtl:SetTexture(self.texture)
--self.mtl:SetColor(1,0,0)
self.map:SetMaterial(self.mtl)
self.entity:SetRenderTarget(self.texture)
self.map:SetParent(World:GetCurrent():FindEntity("CameraPlayer"),true)
self.map:SetPosition(-1,0,1,false)
--self.entity:SetZoom(250)
self.entity:SetFOV(45)
end
function Script:UpdateWorld()
self.posPlayer = player:GetPosition(true)
self.rotPlayer = World:GetCurrent():FindEntity("CameraPlayer"):GetRotation(true)
self.entity:SetPosition(self.posPlayer.x, self.posPlayer.y+40, self.posPlayer.z, true)
self.entity:SetRotation(90,self.rotPlayer.y,0,false)
end
function Script:PostRender(context)
context:DrawImage(self.texture,0,context:GetHeight()-128,128,128 )
end