heyho,
Ich habe heute folgendes Problem, ich habe ein HUD es passt alles soweit von der Alpha wenn ich es ohne renderTarget mache. Aber sobald ich es auf ein renderTarget zeichnen lasse, werden die Elemente transparenter als sie eigentlich sein sollen (Selbst bei Elementen mit 255 als Transparenzwert)
ohne Rendertarget
Lua
self.skin:render(20*px, 20*px, 100*px, 100*px)
dxDrawText(getMainTime(), 124*px, 20*py, 196*px, 47*py, tocolor(255, 255, 255, 255), 2.00*px, "sans", "left", "top", false, false, false, false, false)
dxDrawLine(124*px, 47*py, 305*px, 47*py, tocolor(255, 255, 255, 255), 1*py, false)
dxDrawText(localPlayer.name, 196*px, 29*py, 306*px, 47*py, tocolor(255, 255, 255, 255), 1.00*py, "sans", "left", "center", true, false, false, false, false)
dxDrawRectangle(124*px, 66*py, 182*px, 14*py, tocolor(0, 0, 0, 137), false)
dxDrawRectangle(124*px, 66*py, ((182 / localPlayer.percentEXP) * 100)*px, 14*py, tocolor(254, 138, 0, 189), false)
dxDrawText(("Level: %s"):format(localPlayer.level), 124*px, 52*py, 306*px, 66*py, tocolor(255, 255, 255, 255), 1.00*py, "default-bold", "left", "bottom", true, false, false, false, false)
dxDrawText(("%s / %s EXP"):format(localPlayer.currEXP, localPlayer.nextlvlEXP), 124*px, 66*py, 306*px, 80*py, tocolor(255, 254, 254, 255), 0.80*py, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("", 124*px, 80*py, 306*px, 94*py, tocolor(255, 254, 254, 255), 0.80*py, "default-bold", "center", "center", false, false, false, false, false) -- "+ 3999 EXP"
dxDrawRectangle(124*px, 84*py, 182*px, 14*py, tocolor(0, 0, 0, 137), false)
dxDrawRectangle(124*px, 84*py, ((182 * localPlayer.health) / 100)*px, 14*py, (localPlayer.health > 20 and tocolor(0, 125, 0, 189) or tocolor(125, 0, 0, 255)), false)
dxDrawRectangle(124*px, 84*py, ((182 * localPlayer.armor) / 100)*px, 14*py, tocolor(0, 0, 125, 189), false)
dxDrawText(("%s %s"):format(math.round(localPlayer.health), "%"), 124*px, 84*py, 306*py, 98*py, tocolor(255, 254, 254, 255), 0.80, "default-bold", "center", "center", false, false, false, false, false)
Alles anzeigen
Externer Inhalt
www11.pic-upload.de
Inhalte von externen Seiten werden ohne Ihre Zustimmung nicht automatisch geladen und angezeigt.
mit Rendertarget
Lua
self.renderTarget = dxCreateRenderTarget(305*px, 120*py, true)
-- (...)
dxSetRenderTarget(self.renderTarget, true)
self.skin:render(20*px, 20*px, 100*px, 100*px)
dxDrawText(getMainTime(), 124*px, 20*py, 196*px, 47*py, tocolor(255, 255, 255, 255), 2.00*px, "sans", "left", "top", false, false, false, false, false)
dxDrawLine(124*px, 47*py, 305*px, 47*py, tocolor(255, 255, 255, 255), 1*py, false)
dxDrawText(localPlayer.name, 196*px, 29*py, 306*px, 47*py, tocolor(255, 255, 255, 255), 1.00*py, "sans", "left", "center", true, false, false, false, false)
dxDrawRectangle(124*px, 66*py, 182*px, 14*py, tocolor(0, 0, 0, 137), false)
dxDrawRectangle(124*px, 66*py, ((182 / localPlayer.percentEXP) * 100)*px, 14*py, tocolor(254, 138, 0, 189), false)
dxDrawText(("Level: %s"):format(localPlayer.level), 124*px, 52*py, 306*px, 66*py, tocolor(255, 255, 255, 255), 1.00*py, "default-bold", "left", "bottom", true, false, false, false, false)
dxDrawText(("%s / %s EXP"):format(localPlayer.currEXP, localPlayer.nextlvlEXP), 124*px, 66*py, 306*px, 80*py, tocolor(255, 254, 254, 255), 0.80*py, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("", 124*px, 80*py, 306*px, 94*py, tocolor(255, 254, 254, 255), 0.80*py, "default-bold", "center", "center", false, false, false, false, false) -- "+ 3999 EXP"
dxDrawRectangle(124*px, 84*py, 182*px, 14*py, tocolor(0, 0, 0, 137), false)
dxDrawRectangle(124*px, 84*py, ((182 * localPlayer.health) / 100)*px, 14*py, (localPlayer.health > 20 and tocolor(0, 125, 0, 189) or tocolor(125, 0, 0, 255)), false)
dxDrawRectangle(124*px, 84*py, ((182 * localPlayer.armor) / 100)*px, 14*py, tocolor(0, 0, 125, 189), false)
dxDrawText(("%s %s"):format(math.round(localPlayer.health), "%"), 124*px, 84*py, 306*py, 98*py, tocolor(255, 254, 254, 255), 0.80, "default-bold", "center", "center", false, false, false, false, false)
dxSetRenderTarget()
dxDrawImage(0, 0, 305*px, 120*py, self.renderTarget, 0, 0, 0, tocolor(255, 255, 255, 255))
Alles anzeigen
Externer Inhalt
www11.pic-upload.de
Inhalte von externen Seiten werden ohne Ihre Zustimmung nicht automatisch geladen und angezeigt.
Wisst ihr vlt. woran das liegt?
- StivIK