Jump to content




Resizable Window?

help lua computer

9 replies to this topic

#1 LabyStudio

  • Members
  • 39 posts

Posted 14 October 2013 - 12:29 PM

Resizable Window?
✔ Movable window?
✔ "mouse_click" in a movable window?

Posted Image
I've tried but I can't do this :/
[Pastebin]
I need this for my program.. please help!

#2 M4sh3dP0t4t03

  • Members
  • 255 posts
  • LocationGermany

Posted 14 October 2013 - 01:08 PM

Is this some sort of an OS/Graphical shell? Or is it a tutorial for an OS? Because if it is you would have to say which one it is and you should also post the source code so we could help you.

#3 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 14 October 2013 - 02:10 PM

You would have to check where the user clicks: if he/she clicked on the title bar and after that dragged his/her mouse then move the window up/down and left/right as many pixels as they moved their mouse. Same with resize. If you have multiple windows then I would recommend to have them as "objects". Tutorial for OOP in Lua can be found here.

#4 LabyStudio

  • Members
  • 39 posts

Posted 14 October 2013 - 02:40 PM

 KingOfNoobs, on 14 October 2013 - 01:08 PM, said:

Is this some sort of an OS/Graphical shell? Or is it a tutorial for an OS? Because if it is you would have to say which one it is and you should also post the source code so we could help you.
[Pastebin] move window

#5 LabyStudio

  • Members
  • 39 posts

Posted 15 October 2013 - 12:25 PM

someone has an idea?

#6 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 15 October 2013 - 12:48 PM

You should be looking at the mouse click coordinates relative to the actual window position rather than simply checking if they are in one absolute position of the screen.

#7 LabyStudio

  • Members
  • 39 posts

Posted 15 October 2013 - 01:00 PM

 Lyqyd, on 15 October 2013 - 12:48 PM, said:

You should be looking at the mouse click coordinates relative to the actual window position rather than simply checking if they are in one absolute position of the screen.
yes.. but that does not work :/
www.pastebin.com/jJTRsGFB

#8 CoderPuppy

  • Members
  • 121 posts

Posted 15 October 2013 - 02:33 PM

On line 28 you have:
if XY2 == "X+8,Y" and button == 1 then -- #### X position
It's checking if XY2 is equal to "X+8,Y", the variables aren't getting replaced. Replace "X+8,Y" with (X + 8) .. "," .. Y.

#9 LabyStudio

  • Members
  • 39 posts

Posted 16 October 2013 - 06:32 AM

hmm...

#10 LabyStudio

  • Members
  • 39 posts

Posted 16 October 2013 - 06:36 AM

 CoderPuppy, on 15 October 2013 - 02:33 PM, said:

On line 28 you have:
if XY2 == "X+8,Y" and button == 1 then -- #### X position
It's checking if XY2 is equal to "X+8,Y", the variables aren't getting replaced. Replace "X+8,Y" with (X + 8) .. "," .. Y.

Thank you :D
[Pastebin]





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users