- Joined
- Apr 19, 2008
- Messages
- 305
- Reaction score
- 20
/title
Hey there peeps, the title says it all.
My text size is too big for it's canvas. How can i fix this?
Code snippet:
Textboard base
What i'm trying to put in (Ignore the sprite / just press 1 to...)
Image of what the actual result is:
Thanks in advance
Joël
Edit: The GXPEngine is provided by my school, for this project obviously.
Hey there peeps, the title says it all.
My text size is too big for it's canvas. How can i fix this?
Code snippet:
Textboard base
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using GXPEngine;
public class TextBoard : Canvas
{
public TextBoard(int width, int height) : base(width, height)
{
SetText("");
}
public void SetText(string text)
{
//graphics.Clear(Color.Gray);
Font drawFont = new Font("ArialBlack", 15);
graphics.DrawString(text, drawFont, Brushes.Black, 0, 0);
}
}
What i'm trying to put in (Ignore the sprite / just press 1 to...)
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using GXPEngine;
public class MenuDesign : Sprite
{
private TextBoard _Level1;
public MenuDesign(int PosX, int PosY, MyGame gamemanager) : base("StartSc.png")
{
Sprite SaxionLogo = new Sprite("Saxion.png");
AddChild(SaxionLogo);
SaxionLogo.scale = 0.5f;
SaxionLogo.x = ((MyGame.WIDTH / 4) * 3);
SaxionLogo.y = ((MyGame.HEIGHT/ 4) * 3);
this.x = PosX;
this.y = PosY;
_Level1 = new TextBoard(MyGame.GRID_WIDTH*2, MyGame.GRID_HEIGHT);
_Level1.x += (MyGame.WIDTH / 2);
_Level1.y += (MyGame.HEIGHT / 2);
_Level1.x += PosX;
_Level1.y += PosY;
AddChild(_Level1);
_Level1.SetText("Press 1 to start level one.");
}
public void Update()
{
}
}
Image of what the actual result is:
You must be registered to see links
Thanks in advance
Joël
Edit: The GXPEngine is provided by my school, for this project obviously.