SCR模块化
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
SCR= require("Zframework/screen")
|
||||||
COLOR= require("Zframework/color")
|
COLOR= require("Zframework/color")
|
||||||
SCN= require("Zframework/scene")
|
SCN= require("Zframework/scene")
|
||||||
LOG= require("Zframework/log")
|
LOG= require("Zframework/log")
|
||||||
|
|||||||
14
Zframework/screen.lua
Normal file
14
Zframework/screen.lua
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
local SCR={
|
||||||
|
w0=1280,h0=720,--Default Screen Size
|
||||||
|
x=0,y=0,--Up-left Coord on screen
|
||||||
|
w=0,h=0,--Fullscreen w/h in gc
|
||||||
|
W=0,H=0,--Fullscreen w/h in shader
|
||||||
|
rad=0,--Radius
|
||||||
|
k=1,--Scale size
|
||||||
|
dpi=1,--DPI from gc.getDPIScale()
|
||||||
|
xOy=love.math.newTransform(),--Screen transformation object
|
||||||
|
}
|
||||||
|
function SCR.setSize(w,h)
|
||||||
|
SCR.w0,SCR.h0=w,h
|
||||||
|
end
|
||||||
|
return SCR
|
||||||
12
main.lua
12
main.lua
@@ -29,17 +29,6 @@ love.keyboard.setKeyRepeat(true)
|
|||||||
love.keyboard.setTextInput(false)
|
love.keyboard.setTextInput(false)
|
||||||
love.mouse.setVisible(false)
|
love.mouse.setVisible(false)
|
||||||
|
|
||||||
SCR={
|
|
||||||
w0=1280,h0=720,--Default Screen Size
|
|
||||||
x=0,y=0,--Up-left Coord on screen
|
|
||||||
w=0,h=0,--Fullscreen w/h in gc
|
|
||||||
W=0,H=0,--Fullscreen w/h in shader
|
|
||||||
rad=0,--Radius
|
|
||||||
k=1,--Scale size
|
|
||||||
dpi=1,--DPI from gc.getDPIScale()
|
|
||||||
xOy=love.math.newTransform(),--Screen transformation object
|
|
||||||
}
|
|
||||||
|
|
||||||
CUSTOMENV={
|
CUSTOMENV={
|
||||||
--Basic
|
--Basic
|
||||||
drop=60,
|
drop=60,
|
||||||
@@ -120,6 +109,7 @@ require("parts/list")
|
|||||||
require("parts/default_data")
|
require("parts/default_data")
|
||||||
require("parts/gametoolfunc")
|
require("parts/gametoolfunc")
|
||||||
|
|
||||||
|
SCR.setSize(1280,720)--Initialize Screen size
|
||||||
FIELD[1]=newBoard()--Initialize field[1]
|
FIELD[1]=newBoard()--Initialize field[1]
|
||||||
|
|
||||||
BLOCKS= require("parts/mino")
|
BLOCKS= require("parts/mino")
|
||||||
|
|||||||
Reference in New Issue
Block a user