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


C++ Render::SetDrawingOffset方法代码示例

本文整理汇总了C++中Render::SetDrawingOffset方法的典型用法代码示例。如果您正苦于以下问题:C++ Render::SetDrawingOffset方法的具体用法?C++ Render::SetDrawingOffset怎么用?C++ Render::SetDrawingOffset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Render的用法示例。


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

示例1: Draw

	void UIDropDown::Draw(Render& p) {
		p.Box(0, 0, this->W, this->H, this->BorderColor);
		p.Box(1, 1, this->W - 2, this->H - 2, this->BackColor);

		Vector2 apos = this->GetAbsoluteLocation();
		p.SetDrawingOffset((int)apos.X + 2, (int)apos.Y);
		UILabel::Draw(p);
	}
开发者ID:CptAsgard,项目名称:TomatoLib,代码行数:8,代码来源:UIDropDown.cpp

示例2: Draw

	void UIManager::Draw(Render& r) {
		this->ShowCursor = this->OverrideShowCursor;

		r.SetDrawingOffset(0, 0);

		for (unsigned int i = 0; i < this->Children.size(); i++) {
			this->Children[i]->_InternalDraw(r);
		}
	}
开发者ID:Bromvlieg,项目名称:TomatoLib,代码行数:9,代码来源:UIManager.cpp

示例3: _InternalDraw

	void UIBase::_InternalDraw(Render& drawer) {
		if (!this->ShouldRender) return;

		Vector2 oldoffset = drawer.GetDrawingOffset();
		Vector2 pos = this->GetAbsoluteLocation();

		drawer.SetDrawingOffset((int)pos.X, (int)pos.Y);
		drawer.EnableClipping((int)pos.X, (int)pos.Y, this->W, this->H);

		bool recorderstarted = false;
		if (this->ShouldRedraw) {
			drawer.RecorderStart();
			recorderstarted = true;
		}
		
		if (!this->Frozen && (this->ShouldRedraw || this->AlwaysRedraw)) {
			this->OnDraw(drawer);
		} else if(this->Buffer != nullptr) {
			drawer.Buffer(this->Buffer);
		}

		if (recorderstarted) {
			if (this->Buffer != nullptr) delete this->Buffer;
			this->Buffer = drawer.RecorderStop();
			this->ShouldRedraw = false;
		}

		for (unsigned int i = 0; i < this->Children.size(); i++) {
			UIBase* p = this->Children[i];
			Vector2 pos2 = p->GetAbsoluteLocation();
			if (pos2.X + p->W < drawer._ClippingPos.X) continue;
			if (pos2.Y + p->H < drawer._ClippingPos.Y) continue;

			if (pos2.X > drawer._ClippingPos.X + drawer._ClippingSize.X) continue;
			if (pos2.Y > drawer._ClippingPos.Y + drawer._ClippingSize.Y) continue;

			p->_InternalDraw(drawer);
		}

		drawer.SetDrawingOffset((int)oldoffset.X, (int)oldoffset.Y);
		drawer.DisableClipping();
	}
开发者ID:edunad,项目名称:TomatoLib,代码行数:42,代码来源:UIBase.cpp


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