Author Topic: Message.cs  (Read 2624 times)

MJRNightmare

  • Visitor
  • *
  • Posts: 10
    • View Profile
    • Email
Message.cs
« on: 2009-12-10, 11:35:06 AM »
Hi all,

Is there trick to make the Message.cs work? I imported the message.cs to a project, won't compile. I created a new message.cs and pasted the contents of the original .cs file, won't compile. I think I read every post on message boxes, still lost. Saw the messagebox with character, but not ready to add more variables to my existing problem of not being able to display messages. There is no Showmessage or any other message functions added yet, just the message.cs in the Source code section. Do I need to declare the added code somewhere? Do message boxes need their on layer?

Thx

Quote
warning CS1668: Invalid search path 'C:\Program Files\Microsoft Visual Studio\VC98\mfc\lib' specified in 'LIB environment variable' -- 'The system cannot find the path specified. '
warning CS1668: Invalid search path 'C:\Program Files\Microsoft Visual Studio\VC98\lib' specified in 'LIB environment variable' -- 'The system cannot find the path specified. '
d:\Documents and Settings\bernapau\Desktop\SGDK212\Library\Projects\Tutorial_1\SpriteBase.cs(2092,11) : warning CS0219: The variable 'result' is assigned but its value is never used
d:\Documents and Settings\bernapau\Desktop\SGDK212\Library\Projects\Tutorial_1\GameForm.cs(118,7) : warning CS0618: 'System.Windows.Forms.Form.AutoScale' is obsolete: 'This property has been deprecated. Use the AutoScaleMode property instead.  http://go.microsoft.com/fwlink/?linkid=14202'
d:\Documents and Settings\bernapau\Desktop\SGDK212\Library\Projects\Tutorial_1\GameForm.cs(177,11) : warning CS0168: The variable 'coopCode' is declared but never used
d:\Documents and Settings\bernapau\Desktop\SGDK212\Library\Projects\Tutorial_1\Message.cs(82,13) : error CS1501: No overload for method 'DrawText' takes '6' arguments

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Message.cs
« Reply #1 on: 2009-12-11, 05:48:01 AM »
Hm... I wonder if I neglected to update Message.cs after changing how text was handled (the only real error is in the DrawText function call, it appears).  I'm running Linux at the moment so I can't give it a quick try.  Maybe next time if someone else hasn't responded by then.

Edit: I got a moment before leaving... it looks like the functionality of Message.cs is provided as part of the standard code now -- I should probably remove Message.cs from the library.  Is there anything you wanted from Message.cs that isn't already provided by the ShowMessage function implemented in GeneralRules.cs (available to both sprites and plans)?
« Last Edit: 2009-12-11, 06:34:29 AM by bluemonkmn »

MJRNightmare

  • Visitor
  • *
  • Posts: 10
    • View Profile
    • Email
Re: Message.cs
« Reply #2 on: 2009-12-11, 08:50:59 AM »
My bad, thought I needed the message.cs after reading the older posts, so I imported from the code folder.

Just tried again without it. Still got an error about too many messages. So I added ClearAllMessages before displaying the new message. All good now.

Requirements:
- Cool or Fire font tileset (I think you need the first character "!" in Slot 33 of the frameset to follow the ASCI position or something, correct me if I'm wrong)
- A Rule with
Clear All Messages
SetMessageFont
SetMessagePosition
ShowMessage

Thx
« Last Edit: 2009-12-11, 08:59:54 AM by MJRNightmare »

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Message.cs
« Reply #3 on: 2009-12-11, 05:16:56 PM »
ClearAllMessages isn't the best solution.  That means it's destroying and re-creating the message every frame.  You should probably just have some way to prevent re-adding the message each frame.