Skip to content
Snippets Groups Projects
Commit 9c97067f authored by dg's avatar dg
Browse files

otehr fixes

git-svn-id: http://svn.net-core.org/repos/t-engine4@109 51575b47-30f0-44d4-a5cc-537603b46e54
parent 160fb214
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,7 @@ function _M:display()
if not self.changed then return self.surface end
local s = self.surface
s:erase()
s:erase(0,0,0,200)
s:merge(tiles:get(nil, 0,0,0, 0,0,0, "border_7.png"), 0, 0)
s:merge(tiles:get(nil, 0,0,0, 0,0,0, "border_9.png"), self.w - 8, 0)
......
......@@ -32,10 +32,9 @@ function _M:display()
self.changed = false
self.surface = core.display.newSurface(self.w, self.h)
self.surface:alpha(200)
-- Erase and the display the tooltip
self.surface:erase(self.bgcolor[1], self.bgcolor[2], self.bgcolor[3])
self.surface:erase(self.bgcolor[1], self.bgcolor[2], self.bgcolor[3], 200)
self.surface:merge(tiles:get(nil, 0,0,0, 0,0,0, "border_7.png"), 0, 0)
self.surface:merge(tiles:get(nil, 0,0,0, 0,0,0, "border_9.png"), self.w - 8, 0)
......
......@@ -373,7 +373,8 @@ static int sdl_surface_drawstring_newsurface(lua_State *L)
{
SDL_Surface **s = (SDL_Surface**)lua_newuserdata(L, sizeof(SDL_Surface*));
auxiliar_setclass(L, "sdl{surface}", -1);
*s = txt;
*s = SDL_DisplayFormatAlpha(txt);
SDL_FreeSurface(txt);
return 1;
}
......@@ -453,7 +454,8 @@ static int sdl_surface_erase(lua_State *L)
int r = lua_tonumber(L, 2);
int g = lua_tonumber(L, 3);
int b = lua_tonumber(L, 4);
SDL_FillRect(*s, NULL, SDL_MapRGBA((*s)->format, r, g, b, 125));
int a = lua_isnumber(L, 5) ? lua_tonumber(L, 5) : 255;
SDL_FillRect(*s, NULL, SDL_MapRGBA((*s)->format, r, g, b, a));
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment