这篇教程C++ GetY函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetY函数的典型用法代码示例。如果您正苦于以下问题:C++ GetY函数的具体用法?C++ GetY怎么用?C++ GetY使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetY函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: FxHomeCallTimerfunc FxHomeCallTimer(object target, proplist fx, int time){ if(!master) { KillBall(); return -1; } if(GetEffect("Blocked", this)) { ox=GetX(); oy=GetY(); return; } DrawParticleLine("Flash", 0, 0, ox-GetX(), oy-GetY(), 1, 0, 0, 15, hometrailparticles); if(time%7 == 0) { for(var i = 0; i < 360; i+=5) { CreateParticle("Flash", Sin(i, 3), -Cos(i, 5), 0, 0, 10, hometrailparticles2, 2); } } fx.x = master->GetX(); fx.y = master->GetY(); var angle = Angle(GetX(), GetY(), fx.x, fx.y, 10); var txdir = Sin(angle, Speed + 12, 10); var tydir = -Cos(angle, Speed + 12, 10); SetXDir((GetXDir() + (txdir - GetXDir())/2)); SetYDir((GetYDir() + (tydir - GetYDir())/2)); CheckForEnemies(HomeCallSize); ox=GetX(); oy=GetY(); var dst = Distance(GetX(), GetY(), fx.x, fx.y); if(dst < 8) { AddShield(master); Sound("Ball::ball_shield", false, 20); var particles = { Prototype = Particles_Glimmer(), R = pR, G = pG, B = pB, Alpha = 255, Size = PV_Linear(10, 0), OnCollision = PC_Bounce(), }; CreateParticle("StarSpark", 0, 0, PV_Random(-60,60), PV_Random(-60, 60), 25, particles, 5); var particle = { Alpha = PV_Linear(255, 0), Size = 50, R = pR, G = pG, B = pB, BlitMode = GFX_BLIT_Additive, }; master->CreateParticle("StarSpark", 0, 0, 0, 0, 7, particle, 4); FollowMaster(); return -1; }}
开发者ID:TheThow,项目名称:OpenClonk-Stuff,代码行数:71,
示例2: GetRightLine Rectangle::GetRight() const { auto p = this->_transform.GetPosition(); auto e = this->_half_extents; return {{p.GetX() + e.GetX(), p.GetY() - e.GetY()}, {p.GetX() + e.GetX(), p.GetY() + e.GetY()}};}
开发者ID:cugone,项目名称:Abrams2015,代码行数:5,
示例3: GetBottomRightVector2D Rectangle::GetBottomRight() const { auto p = this->_transform.GetPosition(); auto e = this->_half_extents; return {p.GetX() + e.GetX(), p.GetY() + e.GetY()};}
开发者ID:cugone,项目名称:Abrams2015,代码行数:5,
示例4: wxLogInfovoid BackgroundDrawer::DrawYAxisVals(wxDC *dc, int tick_len, int line_width) { double min = m_draw->GetDrawInfo()->GetMin(); double max = m_draw->GetDrawInfo()->GetMax(); double dif = max - min; if (dif <= 0) { wxLogInfo(_T("%s %f %f"), m_draw->GetDrawInfo()->GetName().c_str(), min, max); assert(false); } //procedure for calculating distance between marks stolen from SzarpDraw2 double x = dif; double step; int i = 0; if (x < 1) for (;x < 1; x *=10, --i); else for (;(int)x / 10; x /=10, ++i); if (x <= 1.5) step = .1; else if (x <= 3.) step = .2; else if (x <= 7.5) step = .5; else step = 1.; double acc = 1; int prec = m_draw->GetDrawInfo()->GetPrec(); for (int p = prec; p > 0; --p) acc /= 10; double factor = (i > 0) ? 10 : .1; for (;i; i -= i / abs(i)) step *= factor; if (step < acc) step = acc; dc->SetPen(wxPen(GetTimeAxisCol(), line_width, wxSOLID)); int w, h; GetSize(&w, &h); h -= m_bottommargin + m_topmargin; for (double val = max; (min - val) < acc; val -= step) { //for (double val = min; (val - max) < acc; val += step) { int y = GetY(val); dc->DrawLine(m_leftmargin - tick_len, y, m_leftmargin, y); wxString sval = m_draw->GetDrawInfo()->GetValueStr(val, _T("- -")); int textw, texth; dc->GetTextExtent(sval, &textw, &texth); dc->DrawText(sval, m_leftmargin - textw - 1, y + line_width / 2 + 1 ); } dc->SetPen(wxNullPen);}
开发者ID:cyclefusion,项目名称:szarp,代码行数:68,
示例5: SetPositionvoid Triangle::SetX(double x) { SetPosition(x, GetY());}
开发者ID:cugone,项目名称:Abrams2010,代码行数:3,
示例6: returnbool Game_Character::IsInPosition(int x, int y) const { return ((GetX() == x) && (GetY() == y));}
开发者ID:KitoHo,项目名称:Player,代码行数:3,
|