Zitat von Kyuu Coming soon...... I suck... Code: function onInit() font = graphics.newFont("Picture/font1.png") windowSkin = graphics.newWindowSkin("Picture/windowskin2.png") windowSkin.topLeftColor = graphics.packColor(0, 90, 180) windowSkin.topRightColor = graphics.packColor(0, 0, 100) windowSkin.bottomLeftColor = graphics.packColor(0, 0, 150) windowSkin.bottomRightColor = graphics.packColor(0, 0, 50) end function onEventDrawn(event, isHero) local text = event.name local x, y = event:getScreenPosition() local text_width = font:getStringWidth(text) game.screen.drawWindow(windowSkin, x - text_width / 2, y - 40, text_width, font.maxCharHeight, 150) game.screen.drawText(font, x - text_width / 2, y - 40, text) return true end function onBattlerDrawn(battler, isMonster, id) local x, y = battler:getScreenPosition() x = x - 20 y = y - 60 -- draw background game.screen.drawRectangle(true, x - 5, y - 5, 80, 40, graphics.packColor(0, 0, 0, 150)) -- draw battler name game.screen.drawText(font, x, y, battler.name) y = y + font.maxCharHeight -- draw hp text game.screen.drawText(font, x, y, "HP: " .. battler.hp .. "/" .. battler.maxHp) y = y + font.maxCharHeight -- draw hp bar local hp_bar_len = battler.hp / battler.maxHp * 60 game.screen.drawLine(x + 1, y + 1, x + 1 + 60, y + 1, graphics.packColor(0, 0, 0)) -- shadow game.screen.drawLine(x, y , x + hp_bar_len, y, graphics.packColor(0, 128, 0)) return true end Fun!
function onInit() font = graphics.newFont("Picture/font1.png") windowSkin = graphics.newWindowSkin("Picture/windowskin2.png") windowSkin.topLeftColor = graphics.packColor(0, 90, 180) windowSkin.topRightColor = graphics.packColor(0, 0, 100) windowSkin.bottomLeftColor = graphics.packColor(0, 0, 150) windowSkin.bottomRightColor = graphics.packColor(0, 0, 50) end function onEventDrawn(event, isHero) local text = event.name local x, y = event:getScreenPosition() local text_width = font:getStringWidth(text) game.screen.drawWindow(windowSkin, x - text_width / 2, y - 40, text_width, font.maxCharHeight, 150) game.screen.drawText(font, x - text_width / 2, y - 40, text) return true end function onBattlerDrawn(battler, isMonster, id) local x, y = battler:getScreenPosition() x = x - 20 y = y - 60 -- draw background game.screen.drawRectangle(true, x - 5, y - 5, 80, 40, graphics.packColor(0, 0, 0, 150)) -- draw battler name game.screen.drawText(font, x, y, battler.name) y = y + font.maxCharHeight -- draw hp text game.screen.drawText(font, x, y, "HP: " .. battler.hp .. "/" .. battler.maxHp) y = y + font.maxCharHeight -- draw hp bar local hp_bar_len = battler.hp / battler.maxHp * 60 game.screen.drawLine(x + 1, y + 1, x + 1 + 60, y + 1, graphics.packColor(0, 0, 0)) -- shadow game.screen.drawLine(x, y , x + hp_bar_len, y, graphics.packColor(0, 128, 0)) return true end
Foren-Regeln