-
Posts
2,449 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Yue
-
Cool!! Sun = world:FindEntity("Sun") Sun:Turn(1,1,1)
-
Video Bar progress load map.
-
Load the map using Lua script, which has for example a camera and a cube. Is it possible to access the cube of the uploaded map? For example map.cube: Turn (0,1,0)
-
AddHook no Working on Lua. What does debug.sethook do? In the following code, the FPS information is displayed regardless of whether it is before the World: Render --================================================= -- Proyecto : Mars. -- -- Scripter : Yue Rexie. -- -- Archivo : Main.lua -- --================================================= -- Nota : Fichero principal del motor. -- --================================================= -- Imports. import("Imports/VariablesG.lua") --Variables Locales. local tituloAPP = "Mars | v.0.0 | Alpha" local mapa = 0 -- Sistema Gráfico. ventana = Window:Create(tituloAPP, 0, 0, 800, 600, Window.Titlebar + Window.Center ) -- ventana:SetLayout(0,0, 800,600 ) lienzo = Context:Create( ventana ) -- Se crea el mundo. mundo = World:Create() - Here function DrawFPS() lienzo:SetBlendMode(Blend.Alpha) lienzo:DrawText("FPS : "..Time:UPS(),2,2) lienzo:SetBlendMode(Blend.Solid) end debug.sethook(DrawFPS,"l") -- Bucle de carga mapa. while mapa == 0 do --Time:Delay (5000 ) -- Cargando Mapa. Time:Update() mundo:Update() mundo:Render() lienzo:Sync() mapa = Map:Load("Maps/start.map","l") end -- Bucle Principal. while true do -- Salir. if ventana:Closed() or ventana:KeyHit(Key.Escape) then return false end Time:Update() mundo:Update() mundo:Render() --DrawFPS() lienzo:Sync() end -- mundo:Clear()
-
Hi, do you have an executable to test here to be launched in full screen? That way I discard that may be the problem here.
-
Hello, I seem to have found a temporary solution to the drawback with the full screen on 4.4. Error. window=Window:Create(title,0,0,800,600,Window.Fullscreen) Solved. window=Window:Create(title,0,0,1280,960,Window.Fullscreen) window:SetLayout( 0, 0, 1280,960 ) --Solved Problem. I hope this is helpful in finding a solution. Although it may be my monitor or graphics card, I do not know.
-
Hello, I'm using version 4.3. The idea is to close the application. I do not know if it will delete the button and the world before or leadwerks does that automatically.
-
Hello in my learning process, I created a simple button to exit the program through the mouse interaction. The drawback is that I do not know how to do the output? Any suggestions? function Script:PostRender(context) context:SetBlendMode(Blend.Alpha) context:DrawImage(baseBoton,100,100,128,128) context:DrawText("EXIT",145,155 ) context:DrawText("Mouse position: "..window:GetMousePosition():ToString(), 2, 2) local mouse = window:GetMousePosition() if mouse.x > 100 and mouse.x < 225 then if mouse.y > 146 and mouse.y < 176 then context:DrawText("Over Button", 2, 20) if window:MouseDown(Key.LButton) then end end end context:SetBlendMode(Blend.Solid) end
-
Ok, no problem. self.entity:SetFogMode(true)
-
Hello, here there is nothing to do the fog of the camera. Any suggestions? These are the values I have, but I do not see anything meaningful on the screen. --Entity Camera. function Script:Start() self.entity:SetFogRange (0,1000) self.entity:SetFogColor (0.72,0.73,0.67,1.0) self.entity:SetFogAngle (0, 180) self.entity:SetClearColor(0.721, 0.352, 0,1) end
-
Thanks!! Here Perfect, Indeed, the material was the problem.
-
Hi, I have a problem, I I have imported a model of rock to be able to paint rocks on the ground. However I can not visualize the rocks. Any suggestions?
-
Hi, Rick. If it is a false load bar, because I understand that in Lua you can not work with threads. When a certain percentage is reached, the map is loaded and while the load is being loaded the progress bar is paused, and then continues its animation. I put it in a coroutine, because when the coroutine is loaded, it goes to a dead state and it does not run any more. I would like to find another alternative, but I see no other more feasible.
-
-- Loading Barr Progress Map. -- Yue Rexie -- Engine LeadWerks ventana = Window:Create("Test",0,0, 800,600, Window.Titlebar + Window.Center ) lienzo = Context:Create( ventana ) fuente = Font:Load("Fonts/space age.ttf",24) lienzo:SetFont(fuente) mundo = World:Create() local x = 0 mapa = 0 co = coroutine.create(function () mapa = Map:Load("Maps/start.map") end) while x <= 199 do -- Salir. if ventana:Closed() then return false end if ventana:KeyHit(Key.Escape ) then return false end x = x + 1 if x == 150 then coroutine.resume(co) end lienzo:SetBlendMode(Blend.Alpha) lienzo:SetColor(1,1,1) lienzo:DrawText("LOADING", lienzo:GetWidth()/2-fuente:GetTextWidth("LOADING")/2, lienzo:GetHeight()-75 ) lienzo:DrawRect(lienzo:GetWidth()/2-100, lienzo:GetHeight()-50, x, 25) lienzo:SetColor(0.5,0.5,0.5) lienzo:DrawRect(lienzo:GetWidth()/2-100, lienzo:GetHeight()-50,200, 25, 1 ) lienzo:Sync() end while true do if ventana:Closed() then return false end if ventana:KeyHit(Key.Escape ) then return false end Time:Update() mundo:Update() mundo:Render() lienzo:Sync() end
-
Ok, run perfect. Test 2 on Lua. -- Loading Barr Progress Map. -- Yue Rexie -- Engine LeadWerks ventana = Window:Create("Test",0,0, 800,600, Window.Titlebar + Window.Center ) lienzo = Context:Create( ventana ) mundo = World:Create() local x = 0 co = coroutine.create(function () Map:Load("Maps/07-AI and Events.map") end) while x <= 200 do -- Salir. if ventana:Closed() then return false end if ventana:KeyHit(Key.Escape ) then return false end x = x + 1 if x == 100 then coroutine.resume(co) end lienzo:DrawRect(lienzo:GetWidth()/2-100, lienzo:GetHeight()-50, x, 25) lienzo:DrawRect(lienzo:GetWidth()/2-100, lienzo:GetHeight()-50,200, 25, 1 ) lienzo:Sync() end while true do if ventana:Closed() then return false end if ventana:KeyHit(Key.Escape ) then return false end mundo:Update() mundo:Render() lienzo:Sync() end
-
Thanks!! Here on Lua. self.entity:SetDebugPhysicsMode(true)
-
Ok, This is the most real thing I can do. ventana = Window:Create() lienzo = Context:Create(ventana) mundo = World:Create() x = 0 mapa = 0 function Loading() lienzo:DrawText("Loading Map...",lienzo:GetWidth()/2,lienzo:GetHeight()/2+75) lienzo:Sync() end while x <= 200 do x = x + 1 if x == 100 then cargar = true end lienzo:DrawRect(lienzo:GetWidth()/2-50,lienzo:GetHeight()/2-25.5, x, 25, 0 ) lienzo:DrawRect(lienzo:GetWidth()/2-50,lienzo:GetHeight()/2-25, 200, 26, 1 ) lienzo:SetBlendMode(Blend.Alpha) lienzo:DrawText("Loading",lienzo:GetWidth()/2,lienzo:GetHeight()/2+25) lienzo:Sync() if cargar == true then mapa = Map:Load("Maps/07-AI and Events.map","Loading") cargar = false end end -- Level 1 Render. while true do if ventana:Closed() or ventana:KeyDown( Key.Escape )then return false end mundo:Update() mundo:Render() lienzo:SetBlendMode(Blend.Alpha) lienzo:SetColor(1,0,0) lienzo:DrawText("HOLA",0,0) lienzo:Sync() end
-
Test My Solution. Bar Progress Animating. No work. 'loadingScreenActive' Where? ventana = Window:Create() lienzo = Context:Create(ventana) mundo = World:Create() local x = 0 local mapa = nil while mapa == nil do mapa = Map:Load("Maps/start.map") x = x + 1 lienzo:DrawRect(0,0, x, 50, 0 ) if x >= 100 then x = 100 end lienzo:Sync() end while true do if ventana:Closed() or ventana:KeyDown( Key.Escape )then return false end mundo:Update() mundo:Render() lienzo:Sync() end
-
How can I see the bodies in the game on Lua?
-
Hello, I have a strange problem when I want to run the full screen in Leadwerks 4.4. local s = Vec2(System:GetGraphicsMode(System:CountGraphicsModes() - 1).x, System:GetGraphicsMode(System:CountGraphicsModes() - 1).y) window = Window:Create("Test",0,0,s.x,s.y,Window.FullScreen) Result :
-
local s = Vec2(System:GetGraphicsMode(System:CountGraphicsModes() - 1).x, System:GetGraphicsMode(System:CountGraphicsModes() - 1).y) window = Window:Create("Test",0,0,s.x,s.y,Window.FullScreen) No, No work, result Here: