当前位置: 首页>>代码示例>>C++>>正文


C++ SetFrame函数代码示例

本文整理汇总了C++中SetFrame函数的典型用法代码示例。如果您正苦于以下问题:C++ SetFrame函数的具体用法?C++ SetFrame怎么用?C++ SetFrame使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SetFrame函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: BWindow

CalcWindow::CalcWindow(BRect frame, BMessage* settings)
	: BWindow(frame, kWindowTitle, B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS)
{
	// create calculator view with calculator description and
	// desktop background color
	BScreen screen(this);
	rgb_color baseColor = screen.DesktopColor();

	SetSizeLimits(100.0, 400.0, 100.0, 400.0);

	frame.OffsetTo(B_ORIGIN);
	fCalcView = new CalcView(frame, baseColor, settings);

	// create replicant dragger
	BRect replicantFrame(frame);
	replicantFrame.top = replicantFrame.bottom - 7.0f;
	replicantFrame.left = replicantFrame.right - 7.0f;
	BDragger* dragger = new BDragger(replicantFrame, fCalcView,
		B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);

	// attach views
	AddChild(fCalcView);
	fCalcView->AddChild(dragger);

	BRect rect;
	if (settings->FindRect("window frame", &rect) == B_OK)
		SetFrame(rect);
	else
		SetFrame(frame, true);
}
开发者ID:mariuz,项目名称:haiku,代码行数:30,代码来源:CalcWindow.cpp

示例2: printf

void Body::UpdateFrame()
{
	if (!(GetFlags() & Body::FLAG_CAN_MOVE_FRAME)) return;

	// falling out of frames
	if (!GetFrame()->IsLocalPosInFrame(GetPosition())) {
		printf("%s leaves frame %s\n", GetLabel().c_str(), GetFrame()->GetLabel().c_str());

		Frame *new_frame = GetFrame()->m_parent;
		if (new_frame) { // don't let fall out of root frame
			matrix4x4d m = matrix4x4d::Identity();
			GetFrame()->ApplyLeavingTransform(m);

			vector3d new_pos = m * GetPosition();

			matrix4x4d rot;
			GetRotMatrix(rot);
			SetRotMatrix(m * rot);
			
			m.ClearToRotOnly();
			SetVelocity(GetFrame()->GetVelocity() + m*(GetVelocity() - 
				GetFrame()->GetStasisVelocityAtPosition(GetPosition())));

			SetFrame(new_frame);
			SetPosition(new_pos);

			Pi::luaOnFrameChanged->Queue(this);
			
			return;
		}
	}

	// entering into frames
	for (std::list<Frame*>::iterator j = GetFrame()->m_children.begin(); j != GetFrame()->m_children.end(); ++j) {
		Frame *kid = *j;
		matrix4x4d m;
		Frame::GetFrameTransform(GetFrame(), kid, m);
		vector3d pos = m * GetPosition();
		if (!kid->IsLocalPosInFrame(pos)) continue;
		
		printf("%s enters frame %s\n", GetLabel().c_str(), kid->GetLabel().c_str());

		SetPosition(pos);
		SetFrame(kid);

		matrix4x4d rot;
		GetRotMatrix(rot);
		SetRotMatrix(m * rot);
				
		// get rid of transforms
		m.ClearToRotOnly();
		SetVelocity(m*(GetVelocity() - kid->GetVelocity())
			+ kid->GetStasisVelocityAtPosition(pos));

		Pi::luaOnFrameChanged->Queue(this);

		break;
	}
}
开发者ID:AaronSenese,项目名称:pioneer,代码行数:59,代码来源:Body.cpp

示例3: PROFILE_SCOPED

void ShipCockpit::RenderCockpit(Graphics::Renderer* renderer, const Camera* camera, Frame* frame)
{
	PROFILE_SCOPED()
	renderer->ClearDepthBuffer();
	SetFrame(frame);
	Render(renderer, camera, m_translate, m_transform);
	SetFrame(nullptr);
}
开发者ID:Action-Committee,项目名称:pioneer,代码行数:8,代码来源:ShipCockpit.cpp

示例4: SetFrame

void hgeAnimation::Play()
{
    bPlaying=true;
    fSinceLastFrame=-1.0f;
    if(Mode & HGEANIM_REV) {
        nDelta = -1;
        SetFrame(nFrames-1);
    } else {
        nDelta = 1;
        SetFrame(0);
    }
}
开发者ID:AjaxWang1989,项目名称:hge,代码行数:12,代码来源:hgeanim.cpp

示例5: SetFrame

void hgeAnimation::SetMode(const int mode) {
    mode_ = mode;

    if (mode & HGEANIM_REV) {
        delta_ = -1;
        SetFrame(frames_ - 1);
    }
    else {
        delta_ = 1;
        SetFrame(0);
    }
}
开发者ID:kvakvs,项目名称:hge,代码行数:12,代码来源:hgeanim.cpp

示例6: SetFrame

void hgeAnimation::SetMode(anim_mode_t mode)
{
	m_play_mode = mode;

	if (mode & HGEANIM_REV)
	{
		m_delta = -1;
		SetFrame(m_frame_count - 1);
	}
	else
	{
		m_delta = 1;
		SetFrame(0);
	}
}
开发者ID:bagobor,项目名称:hgepp,代码行数:15,代码来源:animation.cpp

示例7: SetFrameStart

void Vessel::SetFrameGroup(StartAndEndFrameInfo* pFameInfo, float FrameSpeed)
{
	SetFrameStart( pFameInfo->StartFrame );
	SetEndFrame( pFameInfo->EndFrame );
	SetFrame( GetFrameStart() );
	SetFrameSpeed( FrameSpeed );  
}
开发者ID:mightymouse2016,项目名称:wii-bolt-thrower,代码行数:7,代码来源:Vessel.cpp

示例8: EMIT_SOUND

void CWallHealth::Recharge(void)
{
	EMIT_SOUND( this, CHAN_ITEM, "items/medshot4.wav", 1.0, ATTN_NORM );
	m_iJuice = gSkillData.GetHealthChargerCapacity();
	SetFrame( 0 );
	SetThink( &CWallHealth::SUB_DoNothing );
}
开发者ID:oskarlh,项目名称:HLEnhanced,代码行数:7,代码来源:CWallHealth.cpp

示例9: s

// Clean up windows used for displaying the view.
bool DrawingView::OnClose(bool deleteWindow)
{
  if (!GetDocument()->Close())
    return false;

  // Clear the canvas in  case we're in single-window mode,
  // and the canvas stays.
  canvas->ClearBackground();
  canvas->view = (wxView *) NULL;
  canvas = (MyCanvas *) NULL;

  wxString s(wxTheApp->GetAppName());
  if (frame)
    frame->SetTitle(s);

  SetFrame((wxFrame*)NULL);

  Activate(false);

  if (deleteWindow)
  {
    delete frame;
    return true;
  }
  return true;
}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:27,代码来源:view.cpp

示例10: SetColor

void CE_CBeam::BeamInit( const char *pSpriteName, float width )
{
	SetColor( 255, 255, 255 );
	SetBrightness( 255 );
	SetNoise( 0 );
	SetFrame( 0 );
	SetScrollRate( 0 );
	SetModelName( MAKE_STRING( pSpriteName ) );
	SetRenderMode( kRenderTransTexture );
	SetTexture( engine->PrecacheModel( pSpriteName ) );
	SetWidth( width );
	SetEndWidth( width );
	SetFadeLength( 0 );			// No fade

	for (int i=0;i<MAX_BEAM_ENTS;i++)
	{
		Set_m_hAttachEntity(i,NULL);
		Set_m_nAttachIndex(i, 0);
	}

	m_nHaloIndex	= 0;
	m_fHaloScale	= BEAM_DEFAULT_HALO_SCALE;
	m_nBeamType		= 0;
	m_nBeamFlags    = 0;
}
开发者ID:KissLick,项目名称:sourcemod-npc-in-css,代码行数:25,代码来源:CBeam.cpp

示例11: SetFrame

//////////////////////////////////////////////////////////////////////////////////
//Calculates tensor in reaction CM frame
//This is the same as KVTensP after using SetFrame("CM")
//_________________________________________________________________
KVTensPCM::KVTensPCM(void)
{
//
// Createur par default
//
   SetFrame("CM");
}
开发者ID:FableQuentin,项目名称:kaliveda,代码行数:11,代码来源:KVTensPCM.cpp

示例12: WXUNUSED

// What to do when a view is created. Creates actual
// windows for displaying the view.
bool DrawingView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
{
    MyApp& app = wxGetApp();
    if ( app.GetMode() != MyApp::Mode_Single )
    {
        // create a new window and canvas inside it
        m_frame = app.CreateChildFrame(doc, this, true);
        m_frame->SetTitle("Drawing View");

        m_canvas = new MyCanvas(this, m_frame);
        m_frame->Show(true);
    }
    else // single document mode
    {
        // reuse the existing window and canvas
        m_frame = wxStaticCast(app.GetTopWindow(), wxFrame);
        m_canvas = app.GetMainWindowCanvas();
        m_canvas->SetView(this);

        // Associate the appropriate frame with this view.
        SetFrame(m_frame);

        // Make sure the document manager knows that this is the
        // current view.
        Activate(true);

        // Initialize the edit menu Undo and Redo items
        doc->GetCommandProcessor()->SetEditMenu(app.GetMainWindowEditMenu());
        doc->GetCommandProcessor()->Initialize();
    }

    return true;
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:35,代码来源:view.cpp

示例13: Activate

// Clean up windows used for displaying the view.
bool DrawingView::OnClose(bool deleteWindow)
{
    if ( !wxView::OnClose(deleteWindow) )
        return false;

    Activate(false);

    // Clear the canvas in single-window mode in which it stays alive
    if ( wxGetApp().GetMode() == MyApp::Mode_Single )
    {
        m_canvas->ClearBackground();
        m_canvas->ResetView();
        m_canvas = NULL;

        if (GetFrame())
            wxStaticCast(GetFrame(), wxFrame)->SetTitle(wxTheApp->GetAppDisplayName());
    }
    else // not single window mode
    {
        if ( deleteWindow )
        {
            GetFrame()->Destroy();
            SetFrame(NULL);
        }
    }
    return true;
}
开发者ID:BjornBjarnsteins,项目名称:MoneyMaster-3000,代码行数:28,代码来源:view.cpp

示例14: SetFrame

void
SpriteEditWindow::AddFrame	(sint32 add)
{
	m_frame +=add;

	SetFrame(m_frame);
}
开发者ID:jleclanche,项目名称:darkdust-ctp2,代码行数:7,代码来源:spriteeditor.cpp

示例15: Stop

// Fonction à appeler à chaque tours de boucle, prend le temps
// écoulé depuis le dernier appel à la fonction en paramètre
void Animated::anim(float ElapsedTime)
{
    // Si il n'est pas en pause et que l'animation est valide
    if (!Paused && myAnim != NULL)
    {
        // on retranche le temps écoulé a notre compteur
        myElapsedTime -= ElapsedTime;

        // Si Le temps entre chaque frame est atteint
        if (myElapsedTime <= 0.f)
        {
            // On réinitialise notre compteur
            myElapsedTime = myTime;

            // On passe a la frame suivante
            if (static_cast<unsigned>(myCurrentFrame + 1) < myAnim->Size())
                myCurrentFrame++;
            else
            {
                // Ou on a la premiere
                if (myLoop)
                    myCurrentFrame = 0;
                else
                {
                    // Si le mode Loop est désactivé, on stop l'animation
                    Stop();
                }
            }

            // On change la frame
            SetFrame(myCurrentFrame);
        }
    }
}
开发者ID:oktal,项目名称:Bombermelee,代码行数:36,代码来源:Animated.cpp


注:本文中的SetFrame函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。