![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
MP10 DiscussionQ: Johnny Mohseni - July 4, 2007 - On 3.2, what exactly are we expected to do? Simply open a System Window when the #open message is sent to #Dice or in addition also output the internal state?A: Johnny Mohseni - July 4, 2007 - I saw the answer below. I suppose I'll follow those directions but I don't truly understand the benefit of doing this since it seems to be a repeat of what is in our other method. Q: Matt Stockton - July 1, 2007 - On 2.2, I understand how we need to shift the position of the number based on the number's height and width, but I cannot figure out how to access the height and width of the number. Any hints here? How do we do this correctly so that it works with numerous font sizes? A:Nicholas Chen - July 2, 2007. Take a look at the StrikeFontSet class and its class methods. It returns a font that you can query for its width and height. The height should be constant across different characters but the width varies by character or string (unless you are using a fixed width font). Ryan Senior - July 3, 2006 - On 3.2 it asks to open a System Window on dice. I have written code to open a system window from the dice instance, with the label 'Dice'. The window opens, but it doesn't do anything useful. It's just blank. Should there be some text or something in the window? Paul Adamczyk - July 3, 2006 - That window should display the dice. So, you need to create a diceView for the dice and display it in the window. Josh Lintz / Tony Poku July 3 2006 - I can't seem to figure out how to change the text size, though I have managed to distort the all the text in my image (I think I changed something in TextStyle). Can anyone give us a clue. Ryan Senior - I have also had difficulty with this. There are methods that you can pass a font into, however I just found AbstractFont and a few subclasses (I think one was TrueTypeFont or something similar) which required having specific font names for your system. Are there any examples of using these font classes? Lina Forero - I used TextStyle default method to get a valid font object, because I was having problems also using the message drawString:at:font:color (I was writing the name of the font as a string and it didn't work). Hope that helps! Paul Adamczyk - July 3, 2006 - That's correct, drawString:at:font:color: is the right method to call on the canvas. Link to this Page
|