예제 #1
0
bool LHLayer::initWithDictionary(LHDictionary* dictionary){
    
    isMainLayer = false;
    
    uniqueName = dictionary->stringForKey("UniqueName");
    
    if(uniqueName == ""){
        uniqueName = "UntitledLayer_" + stringFromInt(untitledLayersCount);
        ++untitledLayersCount;
    }
    
    setTag(dictionary->intForKey("Tag"));
    m_nZOrder = dictionary->intForKey("ZOrder");
    
    loadUserCustomInfoFromDictionary(dictionary->dictForKey("CustomClassInfo"));
    
    LHArray* childrenInfo = dictionary->arrayForKey("Children");
    for(int i = 0; i< childrenInfo->count(); ++i){
        LHDictionary* childDict = childrenInfo->dictAtIndex(i);
        addChildFromDictionary(childDict);
    }
    
    return true;
}
예제 #2
0
std::string LHDevice::devicePosition(LHDictionary* availablePositions, Size curScr){
    return availablePositions->stringForKey(stringFromInt((int)curScr.width)+"x"+stringFromInt((int)curScr.height));
}