[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Miniwindows help - First time trying this
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Miniwindows help - First time trying this
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please)
Maximum of 6000 characters. Text only please, no HTML.
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Nick Gammon   Australia  (19,435 posts)  [Biography] bio   Forum Administrator
Date Mon 14 Feb 2011 11:40 PM (UTC)  quote  ]
Message
This describes how to drag windows around. It isn't built in, but using this module simplifies it somewhat:

http://www.gammon.com.au/forum/?id=9594

As for the ASCII art, see this:

http://www.gammon.com.au/mushclient/mw_text.htm

In particular the bit near the bottom under Hint 4.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Mon 14 Feb 2011 11:24 PM (UTC)  quote  ]
Message
Rivius said:

A second question. I am trying to display some ASCII art and put some numbers around it, and I was looking into the WindowText function. There seems to be a bit of an issue in drawing the ASCII art with [[my art here]] because it does not make the newline characters as I need it to.

I want to be able to do things like

((((((((---[4]====)))
          ((||}}[5]
==========((||))
==========


where 4 and 5 are variables. Is there an easy work around to this problem?


Yes, you need to use WindowFontInfo() to find out what the height of your font is, then add that height to WindowText's y parameter for each line.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Rivius   (93 posts)  [Biography] bio
Date Mon 14 Feb 2011 06:45 PM (UTC)  quote  ]
Message
I'm playing around with miniwindows for the first time, and I'm having a little trouble getting things going.

Right now, I just want to make the miniwindow draggable. I've tried the code below, and while I can hover and click on the title bar I made, I cannot seem to move the windows from its position.


require "movewindow"
require "display"

wdisplay = GetPluginID ()
check(WindowCreate(wdisplay, 0, 0, 300, 300, 12, 0, ColourNameToRGB("black")))
    WindowShow(wdisplay, true)
	WindowRectOp(wdisplay, 2, 0, 0, 0, 15,  ColourNameToRGB("slategray"))
	WindowRectOp(wdisplay, 1, 0, 0, 0, 0, ColourNameToRGB("slategray"))
    movewindow.add_drag_handler(wdisplay, 0, 0, 0, 15)
	WindowFont (wdisplay, "f", "Courier New", 9, true, false, false, false)


A second question. I am trying to display some ASCII art and put some numbers around it, and I was looking into the WindowText function. There seems to be a bit of an issue in drawing the ASCII art with [[my art here]] because it does not make the newline characters as I need it to.

I want to be able to do things like

((((((((---[4]====)))
((||}}[5]
==========((||))
==========

where 4 and 5 are variables. Is there an easy work around to this problem?
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


1,837 views.

[New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Web site powered by FutureQuest.Net]