using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;
using Rmake.Framework.Logging;
using Rmake.Rendering.APIWrapper;
using Rmake.Rendering.ComponentLayer;
namespace Rmake.GameRendering
{
///
/// 文字列を表示するクラスです。
///
public class TextViewWrapper : GameRenderingView
{
private TextView textView = null;
internal TextView GetTextView()
{
return textView;
}
internal override int LayerIndex
{
get
{
return textView.LayerIndex;
}
set
{
textView.LayerIndex = value;
}
}
///
/// カメラの影響を受けるかどうか
/// trueならばカメラの影響を受ける
/// falseならばカメラの影響を受けない
///
public bool IsDependCamera
{
get{ return textView.IsDependCamera; }
set{ textView.IsDependCamera = value; }
}
public TextViewWrapper()
{
}
internal void Initialize(TextView textView)
{
this.textView = textView;
}
internal override void Finalize(GameRenderingManager manager)
{
manager.Manager.DeleteRenderView(textView);
}
internal override void Render(GameRenderingManager manager)
{
}
internal override void SetVisible(bool visible)
{
textView.ViewVisible = visible;
}
///
/// 文字列を描画したときに
/// 何行かけるかを求める
///
/// 文字列描画の開始位置のx座標
/// 文字列描画の開始位置のy座標
/// 文字列を描画する範囲の幅
/// 文字列を描画する範囲の高さ
/// 文字列
/// 文字列の色
/// 文字列を描画したときに描画できる行数を返す
public int DrawableTextLineCount(int x, int y, int width, int height, string text, int color)
{
return textView.DrawableTextLineCount(x, y, width, height, text, color);
}
///
/// 文字列の描画
///
/// 文字列を描画する領域の左端の座標
/// 文字列を描画する領域の上の端の座標
/// 文字列を描画する領域の幅
/// 文字列を描画する領域の高さ
/// 描画する文字列
/// 文字列の色
/// 文字列の情報。あとでClearTextで消すときなどに使う
public D3DTextData DrawText(int x, int y, int width, int height, string text, int color)
{
return textView.DrawText(x, y, width, height, text, color);
}
}
}