bbb
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
--[[--- | |
Simple 3D benchmark based on samples/test/cube-3d. | |
- Video: http://www.youtube.com/watch?v=Fn54jJYw5y8&list=UUtHX3tIuYEScozlr4GqfF1Q | |
- Machine: macbook pro 2.53GHz i5, NVIDIA GeForce GT 330M 256 MB | |
- Benchmark spec | |
- num of props: 150 | |
- cube per prop : 8x8x8 = 512 | |
- total num of triangles: 12 x 512 x 150 = 921K | |
- frame rate: 60fps |
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
---------------------------------------------------------------- | |
-- Copyright (c) 2010-2011 Zipline Games, Inc. | |
-- All Rights Reserved. | |
-- http://getmoai.com | |
---------------------------------------------------------------- | |
MOAISim.openWindow ( "test", 320, 480 ) | |
viewport = MOAIViewport.new () | |
viewport:setSize ( 320, 480 ) |
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
---------------------------------------------------------------- | |
-- Copyright (c) 2010-2011 Zipline Games, Inc. | |
-- All Rights Reserved. | |
-- http://getmoai.com | |
---------------------------------------------------------------- | |
MOAISim.openWindow ( "test", 320, 480 ) | |
viewport = MOAIViewport.new () | |
viewport:setSize ( 320, 480 ) |
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
if MOAIInputMgr.device.touch then | |
local path = MOAIEnvironment.getCacheDirectory() .. "/hogehoge.txt" | |
local f,msg = io.open(path, "wb") | |
if not f then | |
error("cannot open file:",msg) | |
end | |
f:write(body) | |
f:close() | |
end |
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
-- OOP system from luvit | |
local Object = {} | |
Object.meta = {__index = Object} | |
function Object:create() | |
local meta = rawget(self, "meta") | |
if not meta then error("Cannot inherit from instance object") end | |
return setmetatable({}, meta) | |
end |
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
-- Demonstration of MOAIMesh:setPenWidth(), MOAIGfxDevice.setPenWidth() not-working bug | |
MOAISim.openWindow ( "test", 320, 480 ) | |
MOAIGfxDevice.setClearDepth ( true ) | |
MOAIGfxDevice.setPenWidth( 5) | |
viewport = MOAIViewport.new () | |
viewport:setSize ( 320, 480 ) | |
viewport:setScale ( 320, 480 ) |
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
-- luvit net emulator by luasocket. | |
local socket = require("socket") | |
function net_connect(ip,port) | |
print("net_connect called.", ip, port ) | |
local conn = {} | |
return conn | |
end |
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
local winx1,winy1 = fieldLayer:worldToWnd(x,y,z) | |
local winx2,winy2 = fieldLayer:worldToWnd(x+CELLUNITSZ*CHUNKSZ,y,z+CELLUNITSZ*CHUNKSZ) | |
if winx2 >= 0 and winy2 >= 0 and winx1 <= SCRW and winy1 <= SCRH then |
OlderNewer