SDXFrameWork  0.13
SDXFrameWork
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Public Member Functions | List of all members
SDX::BmpFrame Class Reference

描画用枠を表すクラス. More...

#include <BmpFrame.h>

Inherits SDX::IFrame.

Public Member Functions

 BmpFrame (ImagePack *フレーム画像)
 フレームを作成する. More...
 
bool Make (ImagePack *フレーム画像)
 フレームを作成する. More...
 
void Draw (const Rect &領域, const Color &描画色=Color::White) const
 矩形のフレームを描画. More...
 

Detailed Description

描画用枠を表すクラス.

//Copyright © 2014 SDXFramework
//[License]GNU Affero General Public License, version 3
//[Contact]http://sourceforge.jp/projects/dxframework/
//初期化を行い何かキーを押すと終了する
bool SampleBmpFrame()
{
using namespace SDX;
System::Initialise("sample", 640, 480);
//BmpFrame用の画像を読み込む
ImagePack frameImageA("data/pipo-WindowBase001.png", 9, 3, 3);
ImagePack frameImageB("data/pipo-WindowBase004.png", 9, 3, 3);
//BmpFrameを作成
BmpFrame bmpFrameA(&frameImageA);
BmpFrame bmpFrameB(&frameImageB);
Rect 四角(220,140,200,200);
double 大きさ = 1.0;
while (System::Update())
{
bmpFrameA.Draw({ 0, 0, Input::mouse.x, Input::mouse.y });
bmpFrameB.Draw(四角);
if (Input::key.Up.hold){ 四角.Move(0, -5); }
if (Input::key.Down.hold){ 四角.Move(0, 5); }
if (Input::key.Left.hold){ 四角.Move(-5, 0); }
if (Input::key.Right.hold){ 四角.Move(5, 0); }
if (Input::key.Return.on){ break; }//Enterで終了
}
return true;
}

Constructor & Destructor Documentation

SDX::BmpFrame::BmpFrame ( ImagePack フレーム画像)
inline

フレームを作成する.

フレーム画像は3×3分割した9マスの物が使える

Member Function Documentation

bool SDX::BmpFrame::Make ( ImagePack フレーム画像)
inline

フレームを作成する.

フレーム画像は3×3分割した9マスの物が使える

void SDX::BmpFrame::Draw ( const Rect 領域,
const Color 描画色 = Color::White 
) const
inlinevirtual

矩形のフレームを描画.

右上座標を指定してフレームを描画する

Todo:
ImagePackにSetColorしていた場合の動作がまだ

Implements SDX::IFrame.