Skip to content
Snippets Groups Projects
Commit 6db04719 authored by dg's avatar dg
Browse files

graphics !

git-svn-id: http://svn.net-core.org/repos/t-engine4@189 51575b47-30f0-44d4-a5cc-537603b46e54
parent 5fc33c9b
No related branches found
No related tags found
No related merge requests found
Showing
with 55 additions and 25 deletions
game/data/gfx/tactical_enemy.png

214 B | W: | H:

game/data/gfx/tactical_enemy.png

360 B | W: | H:

game/data/gfx/tactical_enemy.png
game/data/gfx/tactical_enemy.png
game/data/gfx/tactical_enemy.png
game/data/gfx/tactical_enemy.png
  • 2-up
  • Swipe
  • Onion skin
game/data/gfx/tactical_friend.png

231 B | W: | H:

game/data/gfx/tactical_friend.png

346 B | W: | H:

game/data/gfx/tactical_friend.png
game/data/gfx/tactical_friend.png
game/data/gfx/tactical_friend.png
game/data/gfx/tactical_friend.png
  • 2-up
  • Swipe
  • Onion skin
game/data/gfx/tactical_neutral.png

213 B | W: | H:

game/data/gfx/tactical_neutral.png

381 B | W: | H:

game/data/gfx/tactical_neutral.png
game/data/gfx/tactical_neutral.png
game/data/gfx/tactical_neutral.png
game/data/gfx/tactical_neutral.png
  • 2-up
  • Swipe
  • Onion skin
game/data/gfx/target_cursor.png

221 B | W: | H:

game/data/gfx/target_cursor.png

579 B | W: | H:

game/data/gfx/target_cursor.png
game/data/gfx/target_cursor.png
game/data/gfx/target_cursor.png
game/data/gfx/target_cursor.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -29,7 +29,8 @@ rememberDisplayOrder = { TERRAIN }
-- @param tile_h height of a single tile
-- @param fontname font parameters, can be nil
-- @param fontsize font parameters, can be nil
function _M:setViewPort(x, y, w, h, tile_w, tile_h, fontname, fontsize)
function _M:setViewPort(x, y, w, h, tile_w, tile_h, fontname, fontsize, multidisplay)
self.multidisplay = multidisplay
self.display_x, self.display_y = x, y
self.viewport = {width=w, height=h, mwidth=math.floor(w/tile_w), mheight=math.floor(h/tile_h)}
self.tiles = Tiles.new(tile_w, tile_h, fontname, fontsize, true)
......@@ -79,7 +80,7 @@ function _M:save()
})
end
function _M:loaded()
self._map = core.map.newMap(self.w, self.h, self.mx, self.my, self.viewport.mwidth, self.viewport.mheight)
self._map = core.map.newMap(self.w, self.h, self.mx, self.my, self.viewport.mwidth, self.viewport.mheight, self.tile_w, self.tile_h, self.multidisplay)
local mapseen = function(t, x, y, v)
if x < 0 or y < 0 or x >= self.w or y >= self.h then return end
......@@ -241,11 +242,11 @@ function _M:display()
if e.faction then
friend = Faction:factionReaction(self.view_faction, e.faction)
if friend > 0 then
self.tiles:get(nil, 0,0,0, 0,0,0, self.faction_friend):toScreen(self.display_x + (i - self.mx) * self.tile_w, (j - self.my) * self.tile_h)
self.tiles:get(nil, 0,0,0, 0,0,0, self.faction_friend):toScreen(self.display_x + (i - self.mx) * self.tile_w, (j - self.my) * self.tile_h, self.tile_w, self.tile_h)
elseif friend < 0 then
self.tiles:get(nil, 0,0,0, 0,0,0, self.faction_enemy):toScreen(self.display_x + (i - self.mx) * self.tile_w, (j - self.my) * self.tile_h)
self.tiles:get(nil, 0,0,0, 0,0,0, self.faction_enemy):toScreen(self.display_x + (i - self.mx) * self.tile_w, (j - self.my) * self.tile_h, self.tile_w, self.tile_h)
else
self.tiles:get(nil, 0,0,0, 0,0,0, self.faction_neutral):toScreen(self.display_x + (i - self.mx) * self.tile_w, (j - self.my) * self.tile_h)
self.tiles:get(nil, 0,0,0, 0,0,0, self.faction_neutral):toScreen(self.display_x + (i - self.mx) * self.tile_w, (j - self.my) * self.tile_h, self.tile_w, self.tile_h)
end
end
end
......
......@@ -15,7 +15,8 @@ function _M:init(w, h, fontname, fontsize, texture)
end
function _M:get(char, fr, fg, fb, br, bg, bb, image, alpha)
alpha = alpha or 255
alpha = alpha or 0
local dochar = char
local fgidx = 65536 * fr + 256 * fg + fb
local bgidx
if br >= 0 and bg >= 0 and bb >= 0 then
......@@ -31,18 +32,26 @@ function _M:get(char, fr, fg, fb, br, bg, bb, image, alpha)
else
local s
if self.use_images and image then
print("Loading tile", image)
s = core.display.loadImage(self.prefix..image)
else
end
if not s then
local w, h = self.font:size(dochar)
--[[
s = core.display.newSurface(self.w, self.h)
if br >= 0 then
s:erase(br, bg, bb, alpha)
else
s:erase(0, 0, 0, alpha)
end
local w, h = self.font:size(char)
s:drawString(self.font, char, (self.w - w) / 2, (self.h - h) / 2, fr, fg, fb)
]]
if br < 0 then br = nil end
if bg < 0 then bg = nil end
if bb < 0 then bb = nil end
s = core.display.newTile(self.w, self.h, self.font, dochar, (self.w - w) / 2, (self.h - h) / 2, fr, fg, fb, br or 0, bg or 0, bb or 0, alpha)
-- s = core.display.drawStringNewSurface(self.font, char, fr, fg, fb)
end
if self.texture then s = s:glTexture() end
......
......@@ -44,7 +44,7 @@ end
function _M:run()
self.log = LogDisplay.new(0, self.h * 0.8, self.w * 0.5, self.h * 0.2, nil, nil, nil, {255,255,255}, {30,30,30})
self.player_display = PlayerDisplay.new(0, 0, self.w * 0.2, self.h * 0.8, {30,30,0})
self.player_display = PlayerDisplay.new(0, 0, 200, self.h * 0.8, {30,30,0})
self.talents_display = TalentsDisplay.new(self.w * 0.5, self.h * 0.8, self.w * 0.5, self.h * 0.2, {30,30,0})
self.calendar = Calendar.new("/data/calendar_rivendell.lua", "Today is the %s %s of the %s year of the Fourth Age of Middle-earth.\nThe time is %02d:%02d.", 122)
self.tooltip = Tooltip.new(nil, nil, {255,255,255}, {30,30,30})
......@@ -91,7 +91,7 @@ function _M:loaded()
engine.GameTurnBased.loaded(self)
Zone:setup{npc_class="mod.class.NPC", grid_class="mod.class.Grid", object_class="mod.class.Object"}
Map:setViewerActor(self.player)
Map:setViewPort(self.w * 0.2, 0, self.w * 0.8, math.floor(self.h * 0.80), 16, 16)
Map:setViewPort(200, 0, self.w - 200, math.floor(self.h * 0.80), 32, 32, nil, 20, true)
self.key = engine.KeyCommand.new()
end
......
......@@ -22,13 +22,13 @@ newEntity{
newEntity{
define_as = "FLOOR",
name = "floor",
name = "floor", image = "terrain/marble_floor.png",
display = '.', color_r=255, color_g=255, color_b=255,
}
newEntity{
define_as = "WALL",
name = "wall",
name = "wall", image = "terrain/granite_wall1.png",
display = '#', color_r=255, color_g=255, color_b=255,
block_move = true,
block_sight = true,
......@@ -36,7 +36,7 @@ newEntity{
newEntity{
define_as = "DOOR",
name = "door",
name = "door", image = "terrain/granite_door1.png",
display = '+', color_r=238, color_g=154, color_b=77,
block_sight = true,
door_opened = "DOOR_OPEN",
......@@ -44,9 +44,29 @@ newEntity{
newEntity{
define_as = "DOOR_OPEN",
name = "open door",
name = "open door", image = "terrain/granite_door1_open.png",
display = "'", color_r=238, color_g=154, color_b=77,
block_move = false,
block_sight = false,
door_closed = "DOOR",
}
newEntity{
define_as = "GRASS",
name = "grass", image = "terrain/grass.png",
display = '.', color=colors.LIGHT_GREEN,
}
newEntity{
define_as = "FLOWER",
name = "flower",
display = ';', color=colors.YELLOW,
}
newEntity{
define_as = "TREE",
name = "tree", image = "terrain/tree.png",
display = '#', color=colors.LIGHT_GREEN,
block_move = true,
block_sight = true,
}
newEntity{
define_as = "BASE_POTION",
type = "potion", subtype="potion",
display = "!", color=colors.WHITE,
display = "!", color=colors.WHITE, image="object/potion-0x0.png",
encumber = 0.2,
stacking = true,
desc = [[Magical potions can have wildly different effects, from healing to killing you, beware! Most of them function better with a high Magic score]],
......@@ -12,7 +12,7 @@ newEntity{
-------------------------------------------------------
newEntity{ base = "BASE_POTION",
name = "potion of lesser healing",
color = colors.LIGHT_RED,
color = colors.LIGHT_RED, image="object/potion-0x3.png",
level_range = {1, 20},
rarity = 3,
cost = 3,
......@@ -26,7 +26,7 @@ newEntity{ base = "BASE_POTION",
newEntity{ base = "BASE_POTION",
name = "potion of healing",
color = colors.LIGHT_RED,
color = colors.LIGHT_RED, image="object/potion-0x3.png",
level_range = {15, 35},
rarity = 4,
cost = 5,
......@@ -40,7 +40,7 @@ newEntity{ base = "BASE_POTION",
newEntity{ base = "BASE_POTION",
name = "potion of greater healing",
color = colors.LIGHT_RED,
color = colors.LIGHT_RED, image="object/potion-0x3.png",
level_range = {30, 50},
rarity = 5,
cost = 7,
......@@ -54,7 +54,7 @@ newEntity{ base = "BASE_POTION",
newEntity{ base = "BASE_POTION",
name = "potion of full healing",
color = colors.LIGHT_RED,
color = colors.LIGHT_RED, image="object/potion-0x3.png",
level_range = {45, 50},
rarity = 14,
cost = 50,
......@@ -71,7 +71,7 @@ newEntity{ base = "BASE_POTION",
-------------------------------------------------------
newEntity{ base = "BASE_POTION",
name = "potion of lesser mana",
color = colors.LIGHT_BLUE,
color = colors.LIGHT_BLUE, image="object/potion-5x0.png",
level_range = {1, 20},
rarity = 3,
cost = 3,
......@@ -85,7 +85,7 @@ newEntity{ base = "BASE_POTION",
newEntity{ base = "BASE_POTION",
name = "potion of mana",
color = colors.LIGHT_BLUE,
color = colors.LIGHT_BLUE, image="object/potion-5x0.png",
level_range = {15, 35},
rarity = 4,
cost = 5,
......@@ -99,7 +99,7 @@ newEntity{ base = "BASE_POTION",
newEntity{ base = "BASE_POTION",
name = "potion of greater mana",
color = colors.LIGHT_BLUE,
color = colors.LIGHT_BLUE, image="object/potion-5x0.png",
level_range = {30, 50},
rarity = 5,
cost = 7,
......@@ -112,7 +112,7 @@ newEntity{ base = "BASE_POTION",
}
newEntity{ base = "BASE_POTION",
name = "potion of full mana",
name = "potion of full mana", image="object/potion-5x0.png",
color = colors.LIGHT_BLUE,
level_range = {45, 50},
rarity = 14,
......@@ -150,7 +150,7 @@ newEntity{ base = "BASE_POTION",
-------------------------------------------------------
newEntity{ base = "BASE_POTION",
name = "potion of slime mold juice",
color = colors.GREEN,
color = colors.GREEN, image="object/potion-2x0.png",
level_range = {1, 2},
rarity = 4,
cost = 0.01,
......
game/modules/tome/data/gfx/object/potion-0x0.png

450 B

game/modules/tome/data/gfx/object/potion-0x3.png

502 B

game/modules/tome/data/gfx/object/potion-2x0.png

471 B

game/modules/tome/data/gfx/object/potion-5x0.png

473 B

game/modules/tome/data/gfx/terrain/granite_door1.png

486 B

game/modules/tome/data/gfx/terrain/granite_door1_open.png

437 B

game/modules/tome/data/gfx/terrain/granite_wall1.png

794 B

game/modules/tome/data/gfx/terrain/grass.png

684 B

game/modules/tome/data/gfx/terrain/hills.png

804 B

game/modules/tome/data/gfx/terrain/marble_floor.png

99 B

game/modules/tome/data/gfx/terrain/mountain.png

1.32 KiB

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