//*******************************************************************************
CBCGPChartTextObject::CBCGPChartTextObject(CBCGPChartVisualObject* pParentChart, const CString& strText,
		double dblValX, double dblValY,
		const CBCGPBrush& brTextColor, const CBCGPBrush& brFill, const CBCGPBrush& brOutline,
		double dblDistanceFromPoint, double dblAngle, BOOL bDrawConnector)
{
	m_pParentChart = pParentChart;
	m_strText = strText;

	if (dblDistanceFromPoint == _EmptyCoordinate || dblAngle == _EmptyCoordinate)
	{
		m_bDrawConnector = FALSE;

		SetCoordinates(CBCGPPoint(dblValX, dblValY), 
			CBCGPPoint(CBCGPChartObject::_EmptyCoordinate, CBCGPChartObject::_EmptyCoordinate), CM_CHART_VALUES);
	}
	else
	{
		m_bDrawConnector = bDrawConnector;

		if (m_bDrawConnector)
		{
			m_ptAnchor = CBCGPPoint(dblValX, dblValY);
		}

		SetCoordinates(dblValX, dblValY, dblDistanceFromPoint, dblAngle, CM_CHART_VALUE_DIST_ANGLE);
	}
	
	m_format.m_brTextColor = brTextColor;
	m_format.m_brFillColor = brFill;
	m_format.m_outlineFormat.m_brLineColor = brOutline;
}
예제 #2
0
void Item::Init( int x, int y, BulletType bullet )
{
    SetCoordinates( x, y, 48, 48 );
    SetColReg( 0, 0, 48, 48 );

    imgId = 8;
    bulletType = bullet;
    speed = 2.0;
    frame = 0;

    // What kind of gun does it give when picked up?
    if ( bullet == bGEM )
    {
        itemType = iGEM;
    }
    else if ( bullet == bFLOWER )
    {
        itemType = iFLOWER;
    }
    else if ( bullet == bHEART )
    {
        itemType = iHEART;
    }

    active = true;
}
예제 #3
0
void Player::Update()
{
    if ( active )
    {
        IncrementFrame();

        if ( shootCooldownLeft > 0 )
        {
            shootCooldownLeft -= 1;
        }
    }

    if ( deathCooldownLeft > 0 )
    {
        deathCooldownLeft -= 1;
    }

    if ( active == false && deathCooldownLeft <= 0 )
    {
        active = true;
        action = FLYING;
        // Reset coordinates
        SetCoordinates( 0, 768/2 );
    }
}
//*******************************************************************************
void CBCGPChartObject::SetCoordinates(const CBCGPPoint& ptLeftTop, const CBCGPPoint& ptRightBottom, 
									  CBCGPChartObject::CoordinateMode mode)
{
	ASSERT_VALID(this);

	SetCoordinates(ptLeftTop.x, ptLeftTop.y, ptRightBottom.x, ptRightBottom.y, mode);
}
예제 #5
0
static LRESULT CALLBACK GraphicsWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
        PAINTSTRUCT ps;
        HDC hdc;

        switch (msg) {
                // Create the MDI client invisible window
        case WM_CREATE:
                break;
        case WM_PAINT:
                hdc = BeginPaint(hwnd,&ps);
                BitBlt(hdc,0,0,grwindow.width,grwindow.height,
                        grwindow.gcBitmap,0,0,SRCCOPY);
                EndPaint(hwnd,&ps);
                break;
                // Move the child windows
        case WM_SIZE:
                // Position the MDI client window between the tool and status bars
                if (wParam != SIZE_MINIMIZED) {
                        SetCoordinates(hwnd);
                }

                return 0;
                // End application
        case WM_DESTROY:
                ResetForClose(hwnd);
                break;
        }
        caml_gr_handle_event(msg, wParam, lParam);
        return DefWindowProc(hwnd, msg, wParam, lParam);
}
//*******************************************************************************
CBCGPChartObject::CBCGPChartObject(CBCGPChartVisualObject* pParentChart, 
		const CBCGPRect& rcCoordinates, CoordinateMode mode)
{
	CommonInit();

	m_pParentChart = pParentChart;

	SetCoordinates(rcCoordinates, mode);
}
//*******************************************************************************
CBCGPChartRangeObject::CBCGPChartRangeObject(CBCGPChartVisualObject* pParentChart, double dblVal1, double dblVal2, BOOL bHorz, const CBCGPBrush& brFill)
{
	m_pParentChart = pParentChart;
	m_bIsForeground = FALSE;

	if (bHorz)
	{
		SetCoordinates(
			CBCGPPoint(CBCGPChartObject::_EmptyCoordinate, dblVal1), 
			CBCGPPoint(CBCGPChartObject::_EmptyCoordinate, dblVal2), CM_CHART_VALUES);		
	}
	else
	{
		SetCoordinates(
			CBCGPPoint(dblVal1, CBCGPChartObject::_EmptyCoordinate), 
			CBCGPPoint(dblVal2, CBCGPChartObject::_EmptyCoordinate), CM_CHART_VALUES);
	}

	m_format.m_brFillColor = brFill;
	m_format.m_outlineFormat.m_brLineColor.Empty();
}
//*******************************************************************************
CBCGPChartLineObject::CBCGPChartLineObject(CBCGPChartVisualObject* pParentChart, 
		double dblX1, double dblY1, double dblX2, double dblY2, const CBCGPBrush& brLine, double dblLineWidth, 
		CBCGPStrokeStyle* pStrokeStyle)
{
	m_pParentChart = pParentChart;
	SetCoordinates(dblX1, dblY1, dblX2, dblY2, CM_CHART_VALUES);	
	m_format.m_outlineFormat.m_brLineColor = brLine;
	m_format.m_outlineFormat.m_dblWidth = dblLineWidth;

	if (pStrokeStyle != NULL)
	{
		m_format.m_outlineFormat.m_strokeStyle.SetDashStyle(pStrokeStyle->GetDashStyle());
	}
	
}
//*******************************************************************************
CBCGPChartLineObject::CBCGPChartLineObject(CBCGPChartVisualObject* pParentChart, double dblVal, BOOL bHorz, 
										   const CBCGPBrush& brLine, double dblLineWidth, CBCGPStrokeStyle* pStrokeStyle)
{
	m_pParentChart = pParentChart;

	if (bHorz)
	{
		SetCoordinates(CBCGPPoint(CBCGPChartObject::_EmptyCoordinate, dblVal), 
						CBCGPPoint(CBCGPChartObject::_EmptyCoordinate, dblVal), CM_CHART_VALUES);		
	}
	else
	{
		SetCoordinates(CBCGPPoint(dblVal, CBCGPChartObject::_EmptyCoordinate), 
						CBCGPPoint(dblVal, CBCGPChartObject::_EmptyCoordinate), CM_CHART_VALUES);
	}

	m_format.m_outlineFormat.m_brLineColor = brLine;
	m_format.m_outlineFormat.m_dblWidth = dblLineWidth;

	if (pStrokeStyle != NULL)
	{
		m_format.m_outlineFormat.m_strokeStyle = *pStrokeStyle;
	}
}
예제 #10
0
파일: ComboBox.cpp 프로젝트: Yossitrx/MSE
void ComboBox::Hide() {
	chosenText->Hide();
	optionsList->Hide();
	short length = (short)chosenText->GetWidth();
	DWORD dw = (FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
	if (border != BorderType::None) {
		for (short j = coord.Y - 1; j < coord.Y + listSize + 3; j++) {
			for (short i = coord.X - 1; i < coord.X + length + 2; i++) {
				COORD tmpCoord = { i,j };
				SetConsoleCursorPosition(handle, tmpCoord);
				SetConsoleTextAttribute(handle, dw);
				cout << ' ';
			}
		}
		SetCoordinates(coord.X, coord.Y - 1);
	}
}
예제 #11
0
파일: node.cpp 프로젝트: hklaufus/GridLab
clNode::clNode(const int ID, const dMatrix &m)
{
  try
  {
    SetObjectType(otNode);
    SetNodeID(ID);
    ResetHaloNode();
    ResetBoundaryNode();
    SetCoordinates(m);
  }

  catch(clExceptionTree EX)
  {
    EX.AddMethodToTree("clNode::clNode");
    throw EX;
  }
}
예제 #12
0
void Player::ReInit()
{
    imgId = 4;  // Unicorn princess image
    SetCoordinates( 0, 768/2, 128, 128 );
    SetColReg( 29, 30, 72, 76 );
    active = true;

    speed = 5.0;

    action = FLYING;
    frame = 0;
    dir = RIGHT;
    gunDamage = ENEMY;
    dying = false;

    deathCooldownTime = 50;         // max amt of time to respawn from death
    shootCooldownTime = 20;
}
예제 #13
0
bool CGUIDialogTeletext::OnMessage(CGUIMessage& message)
{
  if (message.GetMessage() == GUI_MSG_WINDOW_INIT)
  {
    /* Do not open if no teletext is available */
    if (!g_application.GetAppPlayer().GetTeletextCache())
    {
      Close();
      CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Info, g_localizeStrings.Get(23049), "", 1500, false);
      return true;
    }
  }
  else if (message.GetMessage() == GUI_MSG_NOTIFY_ALL)
  {
    if (message.GetParam1() == GUI_MSG_WINDOW_RESIZE)
    {
      SetCoordinates();
    }
  }
  return CGUIDialog::OnMessage(message);
}
예제 #14
0
void CGUIDialogTeletext::OnInitWindow()
{
  teletextFadeAmount  = 0;
  m_bClose            = false;
  m_windowLoaded      = true;

  SetCoordinates();

  if (!m_TextDecoder.InitDecoder())
  {
    CLog::Log(LOGERROR, "%s: failed to init teletext decoder", __FUNCTION__);
    Close();
  }

  m_pTxtTexture = new CTexture(m_TextDecoder.GetWidth(), m_TextDecoder.GetHeight(), XB_FMT_A8R8G8B8);
  if (!m_pTxtTexture)
  {
    CLog::Log(LOGERROR, "%s: failed to create texture", __FUNCTION__);
    Close();
  }

  CGUIDialog::OnInitWindow();
}
예제 #15
0
파일: start.c 프로젝트: Elohim/FGmud
void create() {
    room::create();
    SetClimate("indoors");
    SetAmbientLight(30);
    SetShort("The start room");
    SetLong( (: DoDesc :));
    SetExits( ([ 
                "south" : "/domains/default/room/wiz_hall",
                ]) );
    SetNoModify(1);
    SetCoordinates("5000,5000,0");
    SetItems( ([
                "tutorial" : "A set of rooms to get familiar with this environment.",
                "town" : "The main town.",
                ]) );
    SetEnters( ([
                //"tutorial" : "/domains/tutorial/room/start",
                "town" : "/domains/town/room/start",
                ]) );
    if(tutorial){
        AddEnter("tutorial", "/domains/tutorial/room/start");
    }
}
예제 #16
0
bool Drawable::SetPosition(int ncol, int nrow)
{
	col = ncol;
	row = nrow;
	SetCoordinates(ncol * 32, nrow * 32);
}
예제 #17
0
Player::Player()
{
    SetCoordinates( -2, -2, 2, 2 );
    SetColReg( -2, -2, 2, 2 );
}
예제 #18
0
파일: ComboBox.cpp 프로젝트: Yossitrx/MSE
void ComboBox::Show() {
	//chosenText->Show();
	if (!firstShow) coord = { coord.X - 1, coord.Y };
	else firstShow = false;
	SetConsoleCursorPosition(handle, coord);
	SetConsoleTextAttribute(handle, chosenText->GetColor());
	char luCorner, ruCorner, ldCorner, rdCorner, vertical, horizontal;
	if (border == BorderType::Single) {
		luCorner = '\xDA';
		horizontal = '\xC4';
		ruCorner = '\xBF';
		vertical = '\xB3';
		rdCorner = '\xD9';
		ldCorner = '\xC0';
	}
	else if (border == BorderType::Double) {
		luCorner = '\xC9';
		horizontal = '\xCD';
		ruCorner = '\xBB';
		vertical = '\xBA';
		rdCorner = '\xBC';
		ldCorner = '\xC8';
	}
	else
	{
		chosenText->Show();
		return;
	}
	short length = (short)chosenText->GetWidth();
	for (short j = coord.Y; j < coord.Y + listSize + 3; j++) {
		for (short i = coord.X; i < coord.X + length + 2; i++) {
			COORD tmpCoord = { i,j };
			SetConsoleCursorPosition(handle, tmpCoord);
			SetConsoleTextAttribute(handle, chosenText->GetColor());
			if (i == coord.X) {
				if (j == coord.Y) {
					cout << luCorner;
				}
				else if (j == coord.Y + listSize + 2) {
					cout << ldCorner;
				}
				else
				{
					cout << vertical;
				}
				continue;
			}
			if (i == coord.X + length + 1) {
				if (j == coord.Y) {
					cout << ruCorner;
				}
				else if (j == coord.Y + listSize + 2) {
					cout << rdCorner;
				}
				else
				{
					cout << vertical;
				}
				continue;
			}
			else {
				if (j == coord.Y || j == coord.Y + listSize + 2) cout << horizontal;
				else cout << ' ';
			}
		}
	}
	SetCoordinates(coord.X + 1, coord.Y + 1);
	SetConsoleCursorPosition(handle, coord);
	chosenText->Print();
	SetConsoleCursorPosition(handle, coord);
}
//*******************************************************************************
void CBCGPChartObject::SetCoordinates(const CBCGPRect& rcCoordinates, CBCGPChartObject::CoordinateMode mode)
{
	ASSERT_VALID(this);

	SetCoordinates(rcCoordinates.left, rcCoordinates.top, rcCoordinates.right, rcCoordinates.bottom, mode);
}