本文整理汇总了C++中SpriteFrame::initFromPICTResource方法的典型用法代码示例。如果您正苦于以下问题:C++ SpriteFrame::initFromPICTResource方法的具体用法?C++ SpriteFrame::initFromPICTResource怎么用?C++ SpriteFrame::initFromPICTResource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpriteFrame
的用法示例。
在下文中一共展示了SpriteFrame::initFromPICTResource方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: openInteraction
void NoradElevator::openInteraction() {
SpriteFrame *frame = new SpriteFrame();
frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kElevatorLabelID, true);
_elevatorControls.addFrame(frame, 0, 0);
frame = new SpriteFrame();
frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kElevatorButtonsID, true);
_elevatorControls.addFrame(frame, 0, 0);
frame = new SpriteFrame();
frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kElevatorDownOnID, true);
_elevatorControls.addFrame(frame, 0, 0);
frame = new SpriteFrame();
frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kElevatorUpOnID, true);
_elevatorControls.addFrame(frame, 0, 0);
_elevatorControls.setCurrentFrameIndex(0);
_elevatorControls.setDisplayOrder(kElevatorControlsOrder);
Common::Rect r;
frame->getSurfaceBounds(r);
r.moveTo(kNoradAlphaElevatorControlsLeft, kNoradAlphaElevatorControlsTop);
_elevatorControls.setBounds(r);
_elevatorControls.startDisplaying();
_elevatorControls.show();
}
示例2: IdlerAnimation
EnergyMonitor::EnergyMonitor() : IdlerAnimation(kEnergyBarID), _energyLight(kWarningLightID) {
PegasusEngine *vm = (PegasusEngine *)g_engine;
_stage = kStageNoStage;
_calibrating = false;
_dontFlash = false;
setBounds(338, 48, 434, 54);
setDisplayOrder(kEnergyBarOrder);
startDisplaying();
SpriteFrame *frame = new SpriteFrame();
frame->initFromPICTResource(vm->_resFork, kLightOffID);
_energyLight.addFrame(frame, 0, 0);
frame = new SpriteFrame();
frame->initFromPICTResource(vm->_resFork, kLightYellowID);
_energyLight.addFrame(frame, 0, 0);
frame = new SpriteFrame();
frame->initFromPICTResource(vm->_resFork, kLightOrangeID);
_energyLight.addFrame(frame, 0, 0);
frame = new SpriteFrame();
frame->initFromPICTResource(vm->_resFork, kLightRedID);
_energyLight.addFrame(frame, 0, 0);
_energyLight.setBounds(540, 35, 600, 59);
_energyLight.setDisplayOrder(kEnergyLightOrder);
_energyLight.startDisplaying();
setScale(1);
setSegment(0, kMaxJMPEnergy);
setEnergyValue(kCasualEnergy);
g_energyMonitor = this;
}
示例3: openFrameSequence
void SpriteSequence::openFrameSequence() {
if (!isSequenceOpen()) {
FrameSequence::openFrameSequence();
if (isSequenceOpen()) {
uint32 numFrames = getNumFrames();
for (uint32 i = 0; i < numFrames; ++i) {
SpriteFrame *frame = new SpriteFrame();
frame->initFromPICTResource(_resFork, i + 0x80, _transparent);
_sprite.addFrame(frame, 0, 0);
}
_sprite.setBounds(_bounds);
}
}
}
示例4: openInteraction
void PressureDoor::openInteraction() {
if (_isUpperDoor) {
_levelsMovie.initFromMovieFile("Images/Norad Alpha/Upper Levels Movie");
_levelsMovie.moveElementTo(kNoradUpperLevelsLeft, kNoradUpperLevelsTop);
} else {
_levelsMovie.initFromMovieFile("Images/Norad Alpha/Lower Levels Movie");
_levelsMovie.moveElementTo(kNoradLowerLevelsLeft, kNoradLowerLevelsTop);
}
_levelsScale = _levelsMovie.getScale();
_levelsMovie.setDisplayOrder(kPressureLevelsOrder);
_levelsMovie.startDisplaying();
_levelsMovie.setSegment(kLevelsSplashStart * _levelsScale, kLevelsSplashStop * _levelsScale);
_levelsMovie.setTime(kLevelsSplashStart * _levelsScale);
_levelsMovie.redrawMovieWorld();
_levelsMovie.show();
_pressureCallBack.setNotification(&_pressureNotification);
_pressureCallBack.initCallBack(&_levelsMovie, kCallBackAtExtremes);
_pressureCallBack.setCallBackFlag(kSplashFinished);
_pressureCallBack.scheduleCallBack(kTriggerAtStop, 0, 0);
_pressureNotification.notifyMe(this, kPressureNotificationFlags, kPressureNotificationFlags);
if (_isUpperDoor) {
_typeMovie.initFromMovieFile("Images/Norad Alpha/Upper Type Movie");
_typeMovie.moveElementTo(kNoradUpperTypeLeft, kNoradUpperTypeTop);
} else {
_typeMovie.initFromMovieFile("Images/Norad Alpha/Lower Type Movie");
_typeMovie.moveElementTo(kNoradLowerTypeLeft, kNoradLowerTypeTop);
}
_typeScale = _typeMovie.getScale();
_typeMovie.setDisplayOrder(kPressureTypeOrder);
_typeMovie.startDisplaying();
_typeMovie.setTime(kDoorSealedTime * _typeScale);
_typeMovie.redrawMovieWorld();
SpriteFrame *frame = new SpriteFrame();
if (_isUpperDoor)
frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kLowerPressureUpOffPICTID);
else
frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kUpperPressureUpOffPICTID);
_upButton.addFrame(frame, 0, 0);
frame = new SpriteFrame();
if (_isUpperDoor)
frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kLowerPressureUpOnPICTID);
else
frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kUpperPressureUpOnPICTID);
_upButton.addFrame(frame, 0, 0);
_upButton.setCurrentFrameIndex(0);
_upButton.setDisplayOrder(kPressureUpOrder);
Common::Rect r;
frame->getSurfaceBounds(r);
if (_isUpperDoor)
r.moveTo(kNoradUpperUpLeft, kNoradUpperUpTop);
else
r.moveTo(kNoradLowerUpLeft, kNoradLowerUpTop);
_upButton.setBounds(r);
_upButton.startDisplaying();
_upButton.show();
frame = new SpriteFrame();
if (_isUpperDoor)
frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kLowerPressureDownOffPICTID);
else
frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kUpperPressureDownOffPICTID);
_downButton.addFrame(frame, 0, 0);
frame = new SpriteFrame();
if (_isUpperDoor)
frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kLowerPressureDownOnPICTID);
else
frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, kUpperPressureDownOnPICTID);
_downButton.addFrame(frame, 0, 0);
_downButton.setCurrentFrameIndex(0);
_downButton.setDisplayOrder(kPressureDownOrder);
frame->getSurfaceBounds(r);
if (_isUpperDoor)
r.moveTo(kNoradUpperDownLeft, kNoradUpperDownTop);
else
r.moveTo(kNoradLowerDownLeft, kNoradLowerDownTop);
_downButton.setBounds(r);
_downButton.startDisplaying();
_downButton.show();
_utilityCallBack.setNotification(&_utilityNotification);
_utilityCallBack.initCallBack(&_utilityTimer, kCallBackAtTime);
_utilityNotification.notifyMe(this, kUtilityNotificationFlags, kUtilityNotificationFlags);
_utilityTimer.setMasterTimeBase(getOwner()->getNavMovie());
if (_playingAgainstRobot)
_neighborhoodNotification->notifyMe(this, kExtraCompletedFlag | kDelayCompletedFlag |
//.........这里部分代码省略.........
示例5: addPICTResourceFrame
void Sprite::addPICTResourceFrame(const ResIDType pictID, bool transparent, const CoordType left, const CoordType top) {
SpriteFrame *frame = new SpriteFrame();
frame->initFromPICTResource(((PegasusEngine *)g_engine)->_resFork, pictID, transparent);
addFrame(frame, left, top);
}