JarrettBillingsley
Joined: 20 Jun 2006 Posts: 457 Location: Pennsylvania!
|
Posted: Sun Nov 18, 2007 9:45 am Post subject: Font.draw drawing white blocks for a frame |
|
|
When you use Font.draw to draw a string, if it draws a glyph for the first time (never been drawn with that font before), it shows that glyph as a white block for one frame, and then after that it draws correctly. I'm guessing this is just a caching issue?
Also I've been working on wrapping ArcLib and exposing it to MiniD. It's going quite well.
Code: | import arc.draw.color : Color;
import arc.font : Font;
import arc.input : key, mouse;
import arc.math.point : Point;
import arc.time;
import arc.window;
arc.window.open("Hello world", 800, 600, false);
arc.input.open();
arc.font.open();
arc.time.open();
local font = Font("arial.ttf", 12);
local font2 = Font("arial.ttf", 32);
local origin = Point(0.0, 0.0);
local white = Color(255, 255, 255);
while(!arc.input.keyDown(key.Quit) && !arc.input.keyDown(key.Esc))
{
arc.input.process();
arc.window.clear();
arc.time.process();
font.draw(toString(arc.time.fps()), origin, white);
if(arc.input.mouseButtonDown(mouse.Left))
font2.draw("Hi guys!", arc.input.mousePos(), white);
arc.time.limitFPS(60);
arc.window.swap();
}
arc.time.close();
arc.font.close();
arc.input.close();
arc.window.close(); |
I've also got arc.sound, arc.texture, arc.draw.*, and arc.math.{rect, size} bound. |
|