Este debate tiene algunos años. Algunos detalles pueden referirse a una versión anterior de Visionaire Studio. Tutoriales actuales
I´m not sure about this but wouldn´t this register the draw function again and again? Since the draw function is called every frame this would get very expensive soon![]()
local health
graphics.addDrawFunc("draw()", 0)
function drawHealthBar()
health = (Values["MC_health"].Int / 100) * 300
-- + --
function draw() graphics.drawBox(200, 200, health, 40, 0x0000ff, 1) end
end
registerEventHandler("mainLoop", "drawHealthBar")I´m not sure about this but wouldn´t this register the draw function again and again? Since the draw function is called every frame this would get very expensive soon
It doesn't really matter, you are just replacing the draw function inside of the table, but you can create the function that registers the draw function outside of the loop.Something along the lines of this...local health graphics.addDrawFunc("draw()", 0) function drawHealthBar() health = (Values["MC_health"].Int / 100) * 300 -- + -- function draw() graphics.drawBox(200, 200, health, 40, 0x0000ff, 1) end end registerEventHandler("mainLoop", "drawHealthBar")
Este tema está cerrado porque nadie ha respondido en más de un año. Puedes hacer tu pregunta en un tema nuevo.
Nuevo temaDeponia, The Whispered World y más de 160 juegos más se crearon con Visionaire Studio. La versión gratuita llega hasta 25 escenas. Para más escenas tienes Visionaire Studio PRO desde 75 €, y para vender tu juego el Indie Bundle por 99 €.
Hasta el 1 de diciembre: el Indie Bundle con un 30 % de descuento con el código BLACKFRIDAY, 69,30 € en lugar de 99 €.