本文整理汇总了C#中IEntityFactory.CreateCanvasEntity方法的典型用法代码示例。如果您正苦于以下问题:C# IEntityFactory.CreateCanvasEntity方法的具体用法?C# IEntityFactory.CreateCanvasEntity怎么用?C# IEntityFactory.CreateCanvasEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEntityFactory
的用法示例。
在下文中一共展示了IEntityFactory.CreateCanvasEntity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AugmentedBoardGameWorld
public AugmentedBoardGameWorld(
I2DRenderUtilities twoDRenderUtilities,
IAssetManagerProvider assetManagerProvider,
IEntityFactory entityFactory)
{
this.Entities = new List<IEntity>();
_renderUtilities = twoDRenderUtilities;
_assetManager = assetManagerProvider.GetAssetManager();
_defaultFont = this._assetManager.Get<FontAsset>("font.Default");
var canvasEntity = entityFactory.CreateCanvasEntity();
var pointThresholdTextBox = new TextBox();
var minPoints = new TextBox();
var maxPoints = new TextBox();
var alpha = new TextBox();
var deviceWidth = new TextBox();
var deviceHeight = new TextBox();
var nextColor = new Button() {Text = "Show Next Color "};
var showDiagnostics = new Button() { Text = "Show Diagnostics" };
var showBoard = new Button() { Text = "Show Board" };
var nextDevice = new Button() { Text = "Next Device" };
var deviceName = new TextBox();
_fullscreen = new Button() { Text = "Fullscreen 1080" };
var camera640x480 = new Button() { Text = "Camera 640x480" };
camera640x480.Click += (sender, args) =>
{
deviceWidth.Text = "640";
deviceHeight.Text = "480";
};
var camera720p = new Button() { Text = "Camera 720p" };
camera720p.Click += (sender, args) =>
{
deviceWidth.Text = "1080";
deviceHeight.Text = "720";
};
var camera1080p = new Button() { Text = "Camera 1080p" };
camera1080p.Click += (sender, args) =>
{
deviceWidth.Text = "1920";
deviceHeight.Text = "1080";
};
var pointThresholdEntry = new HorizontalContainer();
pointThresholdEntry.AddChild(new Label() { Text = "Point Threshold: "}, "100");
pointThresholdEntry.AddChild(pointThresholdTextBox, "*");
var minPointsEntry = new HorizontalContainer();
minPointsEntry.AddChild(new Label() { Text = "Min. Points: " }, "100");
minPointsEntry.AddChild(minPoints, "*");
var maxPointsEntry = new HorizontalContainer();
maxPointsEntry.AddChild(new Label() { Text = "Max. Points: " }, "100");
maxPointsEntry.AddChild(maxPoints, "*");
var renderAlphaEntry = new HorizontalContainer();
renderAlphaEntry.AddChild(new Label() { Text = "Render Alpha: " }, "100");
renderAlphaEntry.AddChild(alpha, "*");
var deviceWidthEntry = new HorizontalContainer();
deviceWidthEntry.AddChild(new Label() { Text = "Device Width: " }, "100");
deviceWidthEntry.AddChild(deviceWidth, "*");
var deviceHeightEntry = new HorizontalContainer();
deviceHeightEntry.AddChild(new Label() { Text = "Device Height: " }, "100");
deviceHeightEntry.AddChild(deviceHeight, "*");
var vert = new VerticalContainer();
vert.AddChild(pointThresholdEntry, "24");
vert.AddChild(minPointsEntry, "24");
vert.AddChild(maxPointsEntry, "24");
vert.AddChild(renderAlphaEntry, "24");
vert.AddChild(nextColor, "24");
vert.AddChild(showDiagnostics, "48");
vert.AddChild(showBoard, "48");
vert.AddChild(nextDevice, "48");
vert.AddChild(deviceName, "24");
vert.AddChild(deviceWidthEntry, "24");
vert.AddChild(deviceHeightEntry, "24");
vert.AddChild(_fullscreen, "48");
vert.AddChild(camera640x480, "48");
vert.AddChild(camera720p, "48");
vert.AddChild(camera1080p, "48");
var hor = new HorizontalContainer();
hor.AddChild(new EmptyContainer(), "*");
hor.AddChild(vert, "200");
var canvas = new Canvas();
canvas.SetChild(hor);
canvasEntity.Canvas = canvas;
var webcamEntity = entityFactory.CreateWebcamEntity(deviceName, deviceWidth, deviceHeight);
var detectorEntity = entityFactory.CreateDetectorEntity(webcamEntity);
detectorEntity.X = 0;
detectorEntity.Y = 0;
var boardAnalyzerEntity = entityFactory.CreateBoardAnalyzerEntity(detectorEntity, pointThresholdTextBox, minPoints, maxPoints);
//.........这里部分代码省略.........