SFML community forums
Help => Graphics => Topic started by: HardCoded on May 18, 2014, 09:44:40 am
-
Okay, so, I downloaded SFML.Net and got to some basic stuff first and drew a circle on a RenderWindow easily. Then, I tried Text and got stuck.
Basically, I've tried two custom fonts and the default Arial font from the system fonts folder without success. I think I know what's wrong but I don't know what's causing it.
I have attached a screenshot of the source code. f.myTextures.Count is always zero for some reason. And that means I can't draw any text.. But I don't know *why* it isn't getting any textures.
public void run
() { Font f
= new Font
("res/font/arial.ttf");}
-
Please write a complete and minimal example that reproduces the problem.
-
What I posted is the exact thing I have.
using SFML.Graphics;namespace AI_CTF
{ class Program
{ static void Main
(string[] args
) { Font f
= new Font
("res/font/arial.ttf"); } }}
If it helps, I've used both the 64 and 32 bit versions of SFML.Net 2.1 and set the build target accordingly but both get me zero textures on the font.
-
Isn't there a way to check if it's correctly loaded?
-
SFML.Net 2.0 64 and 32 bit show zero textures on fonts loaded, too.
using System;using SFML.Graphics;using SFML.Window;namespace AI_CTF
{ class Program
{ static void Main
(string[] args
) { RenderWindow rw
= new RenderWindow
( VideoMode
.DesktopMode,
"RenderWindow" ); Font f
= new Font
("res/font/arial.ttf"); Text t
= new Text
("Text", f
); rw
.Closed += (object sender, EventArgs e
) => { rw
.Close(); }; while (rw
.IsOpen()) { rw
.DispatchEvents(); rw
.Clear(); t
.Draw(rw,
new RenderStates
()); rw
.Display(); } } }}
@G, I duno. I would think it would've thrown an exception if it couldn't load a library =/
-
t
.Draw(rw,
new RenderStates
());
This doesn't work as expected. C# default-constructs structs by zeroing all entries. You want to use the RenderStates.Default constant.
-
I..
Umm..
Oh. My. God.
Thank you very much, sir :-[
Err, still. I know that assuming that myTextures refers to the textures in a font is being evil because assuming the value of private members isn't reliable. But why is the count zero for it? What's it really for? o.0