Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: TextureFont uses wrong font and causes memory violation  (Read 754 times)
tagget
Customers
Community Member
*****
Posts: 243


« on: February 01, 2010, 05:23:46 PM »

I've recently installed VS2010, Windows 7 and downloaded the latest TV3D .dll have noticed that creating a texture font doesn't work.

I'm creating it like this:
Code:
Font = TVText.TextureFont_Create("Segoe UI", "Segoe UI", 10, True, False, False, False)

And using it like this:
Code:
TVText.TextureFont_DrawText(_text, position.x, position.y, globals.RGBA(1, 1, 1, 1))

No matter what font I use they all end up using the System font.

This causes a memory violation exception.
Code:
TVText.TextureFont_GetTextSize(_text, Font, w, h)

Should Font = 0? There's nothing in the log either.

Any thoughts?
Logged
DarekRuman
Customers
Community Member
*****
Posts: 184

game developer


WWW
« Reply #1 on: February 01, 2010, 06:20:00 PM »

First created font index is always 1

so it should be that way :

TVText.TextureFont_DrawText(_text, position.x, position.y, globals.RGBA(1, 1, 1, 1), FONTID = 1)

and

TVText.TextureFont_GetTextSize(_text, 1, w, h)

Is all working great at older release.
Logged

www.reddotgames.pl
tv6.3 tv6.5 developer
games made in TV : Paintball Extreme, Reindeer Adventure, Mole : Great Adventure, Foxy Fox, Włatcy móch : Śnieżna Rozwałka, Włatcy Móch : Magiczni Wojownicy, Ski:), Lowrider Extreme
jviper
Community Member
*
Posts: 2127

Discipline in training


« Reply #2 on: February 01, 2010, 06:52:52 PM »

Weird. Seems to be working for me in the latest release. I am on Windows Vista 64 bit, Visual Studio Express 2008. I have the VB.NET code here.
Logged

JAbstract.....Don't just imagine, make it happen!
tagget
Customers
Community Member
*****
Posts: 243


« Reply #3 on: February 01, 2010, 07:24:05 PM »

Fixed it!

I had mistakenly changed the value of Font elsewhere in the code!

If it can draw text using an invalid fontid and revert to using the System font then the text function should too.

Thanks for the help!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks