Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 6 posts ] 
redpandagames
  Sun Jul 08, 2012 10:08 am
User avatar
Member
I am printing variables in a custom window, but I can't get the commas to show up. If the variable is greater than 999, obviously, I would want the number to be comma separated.

#initialize the window
def self.initialize(x, y, w, h, opacity, back_opacity)
@window = Window_Base.new(x,y,w,h)
@window.contents = Bitmap.new(@window.width - 32, @window.height - 32)
@window.opacity = opacity
@window.back_opacity = back_opacity
end #method

#draw a single variable
def self.variable(x,y,w,h,i)
@window.contents.draw_text(x, y, w, h, "" + "" + "" + $game_variables[i].to_s, 0)
end #method

What do I need to do?

Thanks in advance for your help.

_________________
Red Panda Games
Visual Novel Games


Top Top
 Profile  
 

ZenVirZan
  Sun Jul 08, 2012 12:41 pm
Member

Location: RMXP's Script Editor
Adding the ' "" ' do nothing; it just adds an empty space character to the string. Try this:
Expand to see the code.

_________________
Image


Top Top
 Profile  
 

redpandagames
  Mon Jul 09, 2012 2:16 pm
User avatar
Member
Hmmm. I'm getting commas, but they are in the wrong space and the variable is printing with a different number than what it actually is.

It doesn't seem to be working.


Top Top
 Profile  
 

ZenVirZan
  Tue Jul 10, 2012 1:28 pm
Member

Location: RMXP's Script Editor
Oh right, try this.
I was building the string backwards xD
Expand to see the code.

_________________
Image


Top Top
 Profile  
 

redpandagames
  Sat Jul 28, 2012 7:46 am
User avatar
Member
It is coming up with a really strange value. I think it may be pulling all variables that have values other than 0 or something. It really isn't working...


Top Top
 Profile  
 

ZenVirZan
  Mon Jul 30, 2012 12:01 pm
Member

Location: RMXP's Script Editor
It works for me.
Perhaps you're calling the wrong variable ID in the method call #self.variable(x,y,w,h, i )?

_________________
Image


Top Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 


Who is online

Users browsing this forum: No users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Hosted By: