Jump to content

Yue

Members
  • Posts

    2,302
  • Joined

  • Last visited

Everything posted by Yue

  1. logLW = Texture:Load("Logos/LeadWerks.tex") -- Logo LeadWerks. oldTime = Time:Millisecs() while Time:Millisecs() < oldTime + 5000 do if ventana:Closed() == 100 then return false end lienzo:DrawImage(logLW, lienzo:GetWidth()/2-241,lienzo:GetHeight()/2-73) lienzo:Sync() end logLW:Release() lienzo:Sync() The previous code shows for a moment before moving to the load bar of the stage. The idea is to delete the image when exiting, however, entering the loading bar of the image is still displayed. Any suggestions?
  2. @shadmar Hello, where I write this code. I create a shaders file, then implement it with an object in the scene?
  3. Cool!! Sun = world:FindEntity("Sun") Sun:Turn(1,1,1)
  4. Video Bar progress load map.
  5. 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)
  6. Yue

    debug.sethook?

    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()
  7. 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.
  8. 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.
  9. Yue

    Button Exit

    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.
  10. Yue

    Button Exit

    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
  11. Ok, no problem. self.entity:SetFogMode(true)
  12. 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
  13. Thanks!! Here Perfect, Indeed, the material was the problem.
  14. What am I doing wrong?
  15. 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?
  16. 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.
  17. -- 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
  18. 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
×
×
  • Create New...