Exemplo n.º 1
0
bool 
CKLBUIMultiImgItem::initCore(u32 order,float x,float y, u32 index, IMGITEM* pIndexes, u32 max)
{
	if(!setupPropertyList((const char**)ms_propItems,SizeOfArray(ms_propItems))) {
		return false;
	}

	setInitPos(x, y);

	// 領域を確保
	m_cntImg    = max;
	m_items     = pIndexes;
    if(!m_items) { return false; }
	m_idxMax    = m_cntImg - 1;	// 最大index値を追加する

	REFRESH_A;
	REFRESH_B;

	klb_assert((((s32)order) >= 0), "Order Problem");

	m_order     = order;
	setIndex(index);

	return true;
}
Exemplo n.º 2
0
bool
CKLBUISimpleItem::initCore(u32 order, float x, float y, const char* asset)
{
	if(!setupPropertyList((const char**)ms_propItems,SizeOfArray(ms_propItems))) {
		return false;
	}

	setInitPos(x, y);

	klb_assert((((s32)order) >= 0), "Order Problem");

	m_order = order;

	setStrC(m_asset, asset);

	m_pNode = CKLBUtility::createNodeScript( m_asset, m_order, &m_handle);
	if(!m_pNode) {
		return false;
	}
	getNode()->addNode(m_pNode);

	return true;
}
Exemplo n.º 3
0
bool
CKLBUIScore::initCore(u32 order, s32 order_offset, float x, float y, 
                      const char ** tex_table, float stepX, float stepY, int column, 
                      bool fillzero, bool anim_flag, u32 align, bool countclip)
{
	if(!setupPropertyList((const char**)ms_propItems,SizeOfArray(ms_propItems))) {
		return false;
	}

	setInitPos(x, y);
	m_order         = order;
	m_orderOffset   = order_offset;
	m_stepX         = (int)stepX;
	m_stepY         = (int)stepY;
	m_column        = column;
	m_bFillZero     = fillzero;
	m_anim          = anim_flag;
	m_align         = align;
	m_bCountClip    = countclip;
	m_dotStepX		= 0;
	m_dotStepY		= 0;
	m_value         = 0xFFFFFFFF;
	m_fValue        = -12345678.0f;
	setValue(0);
	setValueFloat(0.0f, 0);
	RESET_B;	// Reset flag done by setValueFloat.


	// align設定用の幅を計算
	m_width  = stepX * column;
	m_height = stepY * column;

	// 保持できる最大値+1を計算
	m_maxvalue = 1;
    for(int i = 0; i < column; i++) { m_maxvalue = m_maxvalue * 10; }

	for(int idx = 0; idx < 10; idx++) {
		setStrC(m_asset[idx], tex_table[idx]);
	}

	CKLBTextureAsset * pTexAsset;
	pTexAsset = (CKLBTextureAsset *)CKLBUtility::loadAssetScript( m_asset[0], &m_handle, NULL, true);

	const char * texname[10];
	for(int i = 0; i < 10; i++) {
		texname[i] = m_asset[i] + 8;
	}

	m_pScoreNode = KLBNEW(CKLBScoreNode);
    if(!m_pScoreNode) {
		CKLBDataHandler::releaseHandle(m_handle);
        return false;
    }
    
    for(int i = 0; i < 10; i++) {
        m_numTex[i] = pTexAsset->getImage(texname[i]);
        if(m_numTex[i] == 0) {
			CKLBScriptEnv::getInstance().error("TEXB differs from [%s] by [%s].", texname[0], texname[i]);
			CKLBDataHandler::releaseHandle(m_handle);
			return false;
		}
    }

    bool bResult = m_pScoreNode->init(	order,
			                            order_offset,
			                            m_numTex,
			                            m_stepX,
										m_stepY,
										column,
										fillzero,
									    anim_flag);
    
    getNode()->addNode(m_pScoreNode, 0);
	m_pScoreNode->markUpMatrix();
	m_bScoreUpdate = true;

	if(!bResult) CKLBDataHandler::releaseHandle(m_handle);

	return bResult;
}