16
DotNet / PostFX problems
« on: April 17, 2011, 07:46:20 pm »
Dunno I downloaded both but I thought I had been using 2.0. Seems I made a mistake, I'll add in the 2.0 binaries and update my code, hopefully that fixes my problem
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
int lenght = headerText.Text.Length
headerText.Position = new Vector2(Width / 2, 50);
headerText.Center = new Vector2((headerText.Size * text.Length) / 2, headerText.Size / 2);
headerText.Font = TidyHandFont;
int lenght = headerText.Text.Length;
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
class MainMenu : Scene
{
Font TidyHandFont;
List<Shape> lines = new List<Shape>();
String2D headerText = new String2D();
Color clearColor = new Color(249, 249, 249);
public void Draw(float frameTime)
{
Program.renderWindow.Clear(clearColor);
foreach (Shape shape in lines)
{
Program.renderWindow.Draw(shape);
Program.renderWindow.Draw(headerText);
}
Program.renderWindow.Display();
}
public void Think(float frameTime)
{
Program.renderWindow.DispatchEvents();
}
public void Init()
{
try
{
TidyHandFont = new Font(@"Content/Fonts/TidyHand.ttf");
}
catch
{
}
Color lineColor = new Color(234,234,234);
uint Width = Program.renderWindow.Width;
for (int i = 0; i < Program.renderWindow.Height / 25; i++)
{
Shape shape = new Shape();
shape.AddPoint(new Vector2(0,i * 25),lineColor);
shape.AddPoint(new Vector2(Width, i * 25), lineColor);
shape.AddPoint(new Vector2(0, i * 25 + 2), lineColor);
shape.AddPoint(new Vector2(Width, i * 25 + 2), lineColor);
lines.Add(shape);
}
headerText.Text = "A cup of tea and a bandit, TEA BANDIT";
headerText.Position = new Vector2(Width / 2, 50);
headerText.Center = new Vector2((headerText.Font.CharacterSize * headerText.Text.Length) / 2, headerText.Font.CharacterSize / 2);
headerText.Color = new Color(2, 49, 153);
}
}
void OnKeyPressed(object sender, KeyEventArgs e)
{
RenderWindow window = (RenderWindow)sender;
if (e.Code == KeyCode.Escape)
window.Close();
}
Fuck just read the other topic, I'll see if it auto updated or something. I'll probably downgrade it otherwise ...