This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
When they put in {*0} Color is generated as how it will look in game. I need it to do the same when they put in {tri} but instead of color it is an image.
Piet Verdriet
Ranch Hand
Joined: Feb 25, 2006
Posts: 266
posted
0
Taylor Swift wrote:
Piet Verdriet wrote:Why are you including those curly brackets ('{' and '}') in your patterns?
Why not just use String's replace(...) method?
But what "real" problem are you trying to solve here?
When they put in {*0} Color is generated as how it will look in game. I need it to do the same when they put in {tri} but instead of color it is an image.
I really have no idea what you're trying to do. What text are you working with? I thought you wanted to replace the underlined part from the text:
http://evercube.net/images/trianglebutton.png
If this is not the case, try explaining your problem again.
Take a look a that generator. Going to spell this one out. You will notice this:
When you input {*1}hello into the generator. It gives you a code for that text for the game. At the bottom, it also shows you how the code looks in game: hello
I see "innerHTML" , which looks like JavaScript to me. "replaceAll", on the other hand, is a Java method - is this question about Java or JavaScript?
Curly braces and stars have special meaning in regular expressions (which is what replaceAll uses), so you'll need to escape them. Try "\\{\\*1\\}" instead of "{*1}".
Ulf Dittmer wrote:I see "innerHTML" , which looks like JavaScript to me. "replaceAll", on the other hand, is a Java method - is this question about Java or JavaScript?
Curly braces and stars have special meaning in regular expressions (which is what replaceAll uses), so you'll need to escape them. Try "\\{\\*1\\}" instead of "{*1}".
I updated the main thread.
The colors work fine. Try the generator. You will notice on "This is how it'll look in game:" when you put in {tri}, it comes out as {tri} instead of showing an image. When you put in {*1} it shows the text in the color it is suppose too.
Just to clear it up:
COLOR IS NOT THE PROBLEM. I NEED TO REPLACE {tri} TEXT WITH AN IMAGE WHEN PUT INTO THE GENERATOR.
Drew you kids a picture:
Taylor Swift
Greenhorn
Joined: Feb 23, 2009
Posts: 5
posted
0
any ideas?
Piet Verdriet
Ranch Hand
Joined: Feb 25, 2006
Posts: 266
posted
0
Taylor Swift wrote:any ideas?
No, because I don't know what exactly you're trying to do and in what language you're doing this. You also didn't answer many of the questions asked to you to clarify your problem.
Perhaps someone else has an idea.
Best of luck though.