Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-05-2012, 02:12 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Using Images for Text?

So I was wanting to use those cool numbers from state.png. I did the math.

Starting at:
PHP Code:
x=1
y
=81 
Using a width of 14 and a height of 16 I was able to draw the numbers using showimg and changeimgpart.

PHP Code:
changeimgpart(423,1+(14*3),81,14,16); 
Resulted : 3
My question is there a way to use images as font's for this?
Reply With Quote
  #2  
Old 03-05-2012, 02:14 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
http://forums.graalonline.com/forums...hp?t=134258865

It depends on how complex you want this to be. For my thread above(using state.png) it's fairly simple because you assume every character is the same width. However if you start rendering letters using a nonfixed-width font image then things get more complex as you need to start taking in to consideration kerning and spacing. This requires you to build an array of each character width, and to keep track of the last letter placement + width before placing the next character.
Reply With Quote
  #3  
Old 03-05-2012, 02:30 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by DustyPorViva View Post
http://forums.graalonline.com/forums...hp?t=134258865

It depends on how complex you want this to be. For my thread above(using state.png) it's fairly simple because you assume every character is the same width. However if you start rendering letters using a nonfixed-width font image then things get more complex as you need to start taking in to consideration kerning and spacing. This requires you to build an array of each character width, and to keep track of the last letter placement + width before placing the next character.
Yes, using state.png. I understand how the width's can give difficulties if not positioned right.. I was only asking is this good to show alot of images like this or would there be easier method, like TTF's..

Quote:
Originally Posted by cbk1994 View Post
It would probably be easier to just make your image into a TTF file, upload it to the server, and use it as a font (e.g. "fontFace = \"myfont.ttf\"").
Was what I was thinking. I only ask this question because of having to show alot of images as numbers..
Reply With Quote
  #4  
Old 03-05-2012, 02:28 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
It would probably be easier to just make your image into a TTF file, upload it to the server, and use it as a font (e.g. "fontFace = \"myfont.ttf\"").
__________________
Reply With Quote
  #5  
Old 03-05-2012, 02:37 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
If the only thing you want to do is display numbers then I suggest an image. Especially if it's for graphical effect, where rendering fonts in large sizes can cause a lot of slowdown. Using an entire font just to display numbers is overkill I think.
Reply With Quote
  #6  
Old 03-05-2012, 02:40 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by DustyPorViva View Post
If the only thing you want to do is display numbers then I suggest an image. Especially if it's for graphical effect, where rendering fonts in large sizes can cause a lot of slowdown. Using an entire font just to display numbers is overkill I think.
Basically you know the bomb's, arrow's, rupee's on the current GUI? I am trying to redo the GUI and im needing to draw alot of numbers, couple dozen.

Get's confusing really fast working with that many images. As for fon't size, I think 14x16 pixels per letter is plenty and I will probably not need any larger or smaller font's.
Reply With Quote
  #7  
Old 03-05-2012, 03:14 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by scriptless View Post
Basically you know the bomb's, arrow's, rupee's on the current GUI? I am trying to redo the GUI and im needing to draw alot of numbers, couple dozen.

Get's confusing really fast working with that many images. As for fon't size, I think 14x16 pixels per letter is plenty and I will probably not need any larger or smaller font's.
Well the thread I linked already handles everything you asked for

As for using a font, the problem is that I'm not aware of any font format that allows bitmap format with more than 2 colors(font color and transparency).
Reply With Quote
  #8  
Old 03-05-2012, 03:27 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by DustyPorViva View Post
Well the thread I linked already handles everything you asked for

As for using a font, the problem is that I'm not aware of any font format that allows bitmap format with more than 2 colors(font color and transparency).
2 colors? Not sure what you mean exactly. I can use 2 color's in font? If so that would work. And transparency? I am confused, wouldnt I just use black and have font color change the color itself? im only curious on how to get the shadow behind the number like state.png kinda does.

Last edited by scriptless; 03-05-2012 at 10:58 AM..
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:49 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.