Just re-downloaded the files, the´re still wrong...
Added the # here and changed the keys, so it works now.
The mouse cannot leave. Don´t know why, I think it is because of the windowedscreen, don´t know how to get the mouse out of that jail...
Too late for thinking now... again tomorrow.
Isometric demo code
- Joakim Christiansen
- Addict
- Posts: 2452
- Joined: Wed Dec 22, 2004 4:12 pm
- Location: Norway
- Contact:
It's because of the windowedscreen, it sucks...mipooh wrote:Just re-downloaded the files, the´re still wrong...
Added the # here and changed the keys, so it works now.
The mouse cannot leave. Don´t know why, I think it is because of the windowedscreen, don´t know how to get the mouse out of that jail...
Too late for thinking now... again tomorrow.
I like logic, hence I dislike humans but love computers.
Use WindowMouseX() and wait for 4.0 Fred said he already fixed it in the new Lib
Visit www.sceneproject.org
Well, its true that windowedscreen is a big pain in the *ss, but its not too hard to sort out... just need to track the cursor and release it or grab it depending on the situation. Here is some example code that was posted on the forums... fweil I think:Joakim Christiansen wrote: It's because of the windowedscreen, it sucks...
Code: Select all
Quit = #False
If InitSprite()
If InitKeyboard()
If InitMouse()
WindowXSize = 800
WindowYSize = 600
If OpenWindow(0,0,0,WindowXSize,WindowYSize,#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_TitleBar|#PB_Window_ScreenCentered,"demo")
hCursor1 = LoadCursor_(0, #IDC_ARROW)
hCursor2 = LoadCursor_(0, #IDC_CROSS)
AddKeyboardShortcut(0, #PB_Shortcut_Escape, #PB_Shortcut_Escape)
WindowedScreenXSize = 640
WindowedScreenYSize = 480
If OpenWindowedScreen(WindowID(),WindowXSize - WindowedScreenXSize,WindowYSize - WindowedScreenYSize,WindowedScreenXSize,WindowedScreenYSize,0,0,0)
SetFrameRate(60)
Repeat
Select WindowEvent()
Case #PB_Event_CloseWindow
Quit = #True
Case #PB_Event_Menu
Select EventMenuID()
Case #PB_Shortcut_Escape
Quit = #True
EndSelect
Case #PB_Event_Gadget
EndSelect
GetCursorPos_(CursorPosition.POINT)
MouseX = CursorPosition\x - WindowX()
MouseY = CursorPosition\y - WindowY() - 20
If MouseX >= WindowXSize - WindowedScreenXSize And MouseX <= WindowXSize And MouseY >= WindowYSize - WindowedScreenYSize And MouseY <= WindowYSize
SetCursor_(hCursor2)
Else
SetCursor_(hCursor1)
EndIf
FlipBuffers()
ClearScreen(255,255,255)
StartDrawing(ScreenOutput())
Locate(10,200)
DrawText("Mouse X/Y=("+Str(MouseX)+","+Str(MouseY)+")")
If MouseX >= WindowXSize - WindowedScreenXSize And MouseX <= WindowXSize And MouseY >= WindowYSize - WindowedScreenYSize And MouseY <= WindowYSize
Locate(10,220)
DrawText("Cursor in")
Else
Locate(10,220)
DrawText("Cursor out")
EndIf
StopDrawing()
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Escape)
Quit = #True
EndIf
Delay(10)
Until Quit
Else
MessageRequester("Error", "Can't open the main windowedscreen", 0)
EndIf
Else
MessageRequester("Error", "Can't open the main window", 0)
EndIf
Else
MessageRequester("Error", "Can't init mouse", 0)
EndIf
Else
MessageRequester("Error", "Can't init keyboard", 0)
EndIf
Else
MessageRequester("Error", "Can't init sprites", 0)
EndIf
End
Not sure what went wrong with the file, but I downloaded it and the changes were there....mipooh wrote:Just re-downloaded the files, the´re still wrong...
Added the # here and changed the keys, so it works now.
The mouse cannot leave. Don´t know why, I think it is because of the windowedscreen, don´t know how to get the mouse out of that jail...
Anyhow, as shown in the code above, its not too hard... another option is to never actually grab the mouse with the windowed screen and then just track it and only respond to actions within the screen itself.
Code: Select all
GetCursorPos_(CursorPosition.POINT) : x = CursorPosition\x - WindowX() : y = CursorPosition\y - WindowY() - 20

EDIT: Forum post with fweil teaching me the ways of windows: viewtopic.php?t=10728&highlight=
Downloaded it again this morning... the properties of the 2 .pb files shows that they are from Dec. 15th... I used the link in the first posting (and removed my cache before downloading).Not sure what went wrong with the file, but I downloaded it and the changes were there....
...if it was shure that it´s coming soon...Use WindowMouseX() and wait for 4.0 Fred said he already fixed it in the new Lib
I am just working at my skills understanding maps and the handling, so I try to make a simple mapeditor ((no announcement!) as all of the solutions offered in PB over the last 3 years are unusable or WIP without progress since a long time). Yesterday I had removed the windowedscreen, but it seems drawing images on an imagegadget in an openedwindow sucks same (here), at least the output looks a bit different...
I will look at the windowedscreen example and maybe try it again.
- Joakim Christiansen
- Addict
- Posts: 2452
- Joined: Wed Dec 22, 2004 4:12 pm
- Location: Norway
- Contact: