-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
283 additions
and
218 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- | ||
--- Generated by EmmyLua(https://github.com/EmmyLua) | ||
--- Created by apple. | ||
--- DateTime: 18/3/26 下午8:39 | ||
--- | ||
local Screen = require("lib/Screen") | ||
local assets = require("lib.cargo").init("assets") | ||
local NewScreen = {} | ||
local bg = love.graphics.newImage("bg.jpeg") | ||
--local font = love.graphics.newFont("assets/font/myfont.ttf", 24) | ||
local font = assets.font.myfont(24) | ||
local titlefont = assets.font.myfont(48) | ||
--local titlefont = love.graphics.newFont("assets/font/myfont.ttf", 48) | ||
local index = 1 | ||
local indexY = 1 | ||
local newActor = {} | ||
newActor.gui = { | ||
{ name = "姓名", prop = "name", guiType = "text", contant = "东方未明", select = { "东方未明", "无名" }, color = { 255, 255, 255 } }, | ||
{ name = "性别", prop = "gender", guiType = "text", contant = "男性", select = { "男性", "女性", "无性" }, color = { 255, 255, 255 } }, | ||
{ name = "年龄", prop = "age", guiType = "int", contant = "16", select = { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25 }, color = { 255, 255, 255 } }, | ||
{ name = "臂力", prop = "Str", guiType = "int", contant = "20", select = { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25 }, color = { 255, 255, 255 } }, | ||
{ name = "根骨", prop = "Con", guiType = "int", contant = "20", select = { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25 }, color = { 255, 255, 255 } }, | ||
{ name = "身法", prop = "Dex", guiType = "int", contant = "20", select = { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25 }, color = { 255, 255, 255 } }, | ||
{ name = "悟性", prop = "Int", guiType = "int", contant = "20", select = { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25 }, color = { 255, 255, 255 } }, | ||
{ name = "五感", prop = "Cho", guiType = "int", contant = "20", select = { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25 }, color = { 255, 255, 255 } }, | ||
{ name = "魅力", prop = "Chn", guiType = "int", contant = "20", select = { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25 }, color = { 255, 255, 255 } }, | ||
{ name = "气血", prop = "HP", guiType = "int", contant = "120", color = { 255, 255, 255 } }, | ||
{ name = "真气", prop = "MP", guiType = "int", contant = "120", color = { 255, 255, 255 } }, | ||
{ name = "确定", guiType = "text", contant = "再想想", select = { "再想想", "确定了" }, color = { 255, 255, 255 } } | ||
} | ||
function NewScreen.new() | ||
love.graphics.setFont(font) | ||
local self = Screen.new() | ||
local title = love.graphics.newText(titlefont, { { 0, 0, 0 }, "前世身份" }) | ||
local t = love.graphics.newText(font) | ||
function self:draw() | ||
love.graphics.draw(bg, 0, 0, 0) | ||
local num = 1 | ||
for i, v in pairs(newActor.gui) do | ||
if i == index then | ||
v.color = { 255, 0, 0 } | ||
else | ||
v.color = { 255, 255, 255 } | ||
end | ||
t:set({ v.color, v.name .. " " .. v.contant }) | ||
love.graphics.print(index, 200, 200) | ||
love.graphics.draw(t, 100, 100 + 30 * num) | ||
num = num + 1 | ||
end | ||
love.graphics.draw(title, 300, 40) | ||
love.graphics.setColor(255, 255, 255, 255) | ||
end | ||
|
||
function self:update(dt) | ||
|
||
end | ||
|
||
function self:keypressed(key) | ||
if key == "e" and index > 1 then | ||
index = index - 1 | ||
elseif key == "d" and index < #newActor.gui then | ||
index = index + 1 | ||
elseif key == "f" then | ||
local v = newActor.gui[index] | ||
if v.select then | ||
v.contant = v.select[math.random(#v.select)] | ||
end | ||
elseif key == "s" and indexY > 1 then | ||
indexY = indexY - 1 | ||
end | ||
end | ||
return self | ||
end | ||
return NewScreen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters