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) 2016 CloudTeam, Inc | |
// All Rights Reserved. | |
//----------------------------------------------------------------// | |
#ifndef DOBA_MOVEMENT_COMPONENT_H | |
#define DOBA_MOVEMENT_COMPONENT_H | |
#include <components/DOBAComponentBase-impl.h> |
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) 2016 CloudTeam, Inc | |
// All Rights Reserved. | |
//----------------------------------------------------------------// | |
#ifndef DOBA_DOBA_COMPONENT_BASE_IMPL_H | |
#define DOBA_DOBA_COMPONENT_BASE_IMPL_H | |
#include <components/DOBAComponentBase.h> | |
#include <doba-util/DOBAGetSetHelper.h> |
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 vsh = [=[ | |
attribute vec4 position; | |
attribute vec2 uv; | |
attribute vec4 color; | |
varying MEDP vec4 colorVarying; | |
varying MEDP vec2 uvVarying; | |
void main () { | |
gl_Position = position; |
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
MOAISim.openWindow ( "test", 1536, 2048 ) | |
viewport = MOAIViewport.new () | |
viewport:setSize ( 1536, 2048 ) | |
viewport:setScale ( 1536, 2048 ) | |
layerMesh = MOAILayer.new () | |
layerMesh:setViewport ( viewport ) | |
layerMesh:setSortMode ( MOAILayer.SORT_NONE ) |
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
-- Label will create a bigger sized font and scale it down | |
-- if view size is less than screen size. | |
function Label:init(text, width, height, font, textSize) | |
DisplayObject.init(self) | |
local scale = math.min(M.getContentScale()) | |
-- do not apply scale fix to Bitmap fonts | |
if type(font) == "string" then | |
local fileBase, fileExt = Resources.extractFileExtension(font) | |
if fileExt == ".fnt" then scale = 1 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
-------------------------------------------------------------------------------- | |
-- Event handler when you touch a layer. | |
-- @param e Event object | |
-------------------------------------------------------------------------------- | |
local TMP_TABLE = {} | |
function TouchHandler:onTouch(e) | |
if not self.touchLayer.touchEnabled then | |
return | |
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
function ResourceMgr:initAtlasDeck(luaFilePath) | |
local atlas = self:loadTable(luaFilePath) | |
local frames = atlas.frames | |
local deck = MOAIGfxQuadDeck2D.new() | |
local boundsDeck = MOAIBoundsDeck.new() | |
deck:setBoundsDeck(boundsDeck) | |
deck.boundsDeck = boundsDeck | |
boundsDeck:reserveBounds(#frames) |
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
function ResourceMgr:loadTable(filePath) | |
local tbl = assert(loadfile(filePath)) | |
setfenv(tbl, {}) | |
return tbl() | |
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
-------------------------------------------------------------------------------- | |
-- DynamicTexturePack.lua | |
-- | |
-- | |
-------------------------------------------------------------------------------- | |
local DynamicTexturePack = class() | |
local Page = class() | |
local MAX_SIZE = MOAIGfxDevice.getMaxTextureSize() or 2048 |
NewerOlder