![]() |
![]() |
#1 |
Registered User
Join Date: Mar 2020
Location: Duesseldorf / Germany
Posts: 39
|
Busy Pointer on screen
I write a little game on with Screens (without BlitzMode) - os friendly. Sometimes I need time to update the bitmap (draw things, etc.). In this time the user can't click on everything. How is it possible to change the mouse pointer to "busy" and after the action back to "normal"? NBusyPointer don't work.
|
![]() |
![]() |
#2 |
Registered User
Join Date: Nov 2019
Location: Celle / Germany
Posts: 147
|
Unfortunetely you cannot change the mousepointer of the screen, you only can change the pointer that is related to a window. Do you have a e.g. backdropped window?
BTW, BusyPointer requires Kickstart/Workbench 2.0+ Last edited by Honitos; 23 November 2023 at 15:49. |
![]() |
![]() |
#3 |
Registered User
Join Date: Mar 2020
Location: Duesseldorf / Germany
Posts: 39
|
Hm...if I can't change the mousepointer for a screen, how can I change the mousepointer system wide (to Busy pointer)? Or is this not possible too?
|
![]() |
![]() |
#4 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,047
|
OS-friendly means you have a window, otherwise you wouldn't be able to handle any input. Just use that window to set the busy pointer. If you don't have a window yet, just open one. A screen does not make sense without a window. In an OS-friendly environment.
|
![]() |
![]() |
#5 |
Registered User
Join Date: Mar 2020
Location: Duesseldorf / Germany
Posts: 39
|
What's the command to change the pointer in a window? I found WPointer but for that I need an own shape. But I want to use the system busy pointer.
|
![]() |
![]() |
#6 |
Registered User
Join Date: Jan 2022
Location: Wales
Posts: 92
|
Create a shape, 'borrow' the system pointer image and just use the WPointer command?
I've always preferred the 'ZZ' pointer of 1.x to the 'stopwatch' of 2.x+ anyways... |
![]() |
![]() |
#7 |
Registered User
Join Date: Nov 2019
Location: Celle / Germany
Posts: 147
|
To set the busy pointer sprite, same as NBusyPointer does, you could use the Intuition function SetWindowPointerA_ ( http://amigadev.elowar.com/read/ADCD.../node03F7.html) that requires Kick 2.0.
The function requires a pointer to the current window that can be get via... WinPointer.l = Peek.l(Addr Window(+window number+)) The taglist can be generated using the Tags()-function. BTW, NBusypointer does not work as it requires a window opened with its own command NWindow. Last edited by Honitos; 19 December 2023 at 23:07. |
![]() |
![]() |
#8 | |
Registered User
Join Date: Sep 2022
Location: Switzerland
Posts: 122
|
Quote:
|
|
![]() |
![]() |
#9 | |
Registered User
Join Date: Mar 2020
Location: Duesseldorf / Germany
Posts: 39
|
Quote:
![]() |
|
![]() |
![]() |
#10 |
Banana
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,217
|
From the Amiga reference manual, there's a hint of how to do in for WB1.3:
Code:
/* data for a busy pointer. ** this data must be in chip memory!!! */ UWORD __chip waitPointer[] = { 0x0000, 0x0000, /* reserved, must be NULL */ 0x0400, 0x07C0, 0x0000, 0x07C0, 0x0100, 0x0380, 0x0000, 0x07E0, 0x07C0, 0x1FF8, 0x1FF0, 0x3FEC, 0x3FF8, 0x7FDE, 0x3FF8, 0x7FBE, 0x7FFC, 0xFF7F, 0x7EFC, 0xFFFF, 0x7FFC, 0xFFFF, 0x3FF8, 0x7FFE, 0x3FF8, 0x7FFE, 0x1FF0, 0x3FFC, 0x07C0, 0x1FF8, 0x0000, 0x07E0, 0x0000, 0x0000, /* reserved, must be NULL */ }; Code:
/* ** beginWait() ** ** Clear the requester with InitRequester. This makes a requester of ** width = 0, height = 0, left = 0, top = 0; in fact, everything is zero. ** This requester will simply block input to the window until ** EndRequest is called. ** ** The pointer is set to a reasonable 4-color busy pointer, with proper offsets. */ BOOL beginWait(struct Window *win, struct Requester *waitRequest) { extern UWORD __chip waitPointer[]; InitRequester(waitRequest); if (Request(waitRequest, win)) { SetPointer(win, waitPointer, 16, 16, -6, 0); SetWindowTitles(win,"Busy - Input Blocked",(UBYTE *)~0); return(TRUE); } else return(FALSE); } /* ** endWait() ** ** Routine to reset the pointer to the system default, and remove the ** requester installed with beginWait(). */ VOID endWait(struct Window *win, struct Requester *waitRequest) { ClearPointer(win); EndRequest(waitRequest, win); SetWindowTitles(win,"Not Busy",(UBYTE *)~0); } |
![]() |
![]() |
#11 |
Banana
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,217
|
OK, so this works in AB3, which has the "chip" keyword to force the section into chip ram. Tested on A1200, WB3.1, 8Mb Fast, and A500, 1.3, 500+500kb.
If just sets the pointer to the "wait" pointer image while that window is in focus. It could be cleared with ClearPointer_ win, or just clicking outside of the window. One weirdness - in an A1200 configuration with Z3 RAM, it doesn't allocate the waitpointer image in chip ram after all, but somewhere up in Fast. So a more robust solution would be to dynamically allocate a bank in chip and copy the data in, but I leave this as an exercise to the reader. I guess something in AmiBlitz3 doesn't like the Z3 RAM. Code:
WBStartup NPrint "Hello World!" FindScreen 0 Window 0,10,10,100,100,9,"SIZE ME!",1,2 *w.Window=Peek.l(Addr Window(0)) WindowOutput 0 win.l=Peek.l(Addr Window(0)) waitPtr.l = ?waitPointer SetPointer_ win, waitPtr, 16, 16, -6, 0 Repeat ev.l=WaitEvent WLocate 0,0 NPrint *w\Width NPrint *w\Height NPrint waitPtr Until ev=$200 End Chip Even waitPointer: Dc.w $0000 Dc.w $0000 Dc.w $0400 Dc.w $07C0 Dc.w $0000 Dc.w $07C0 Dc.w $0100 Dc.w $0380 Dc.w $0000 Dc.w $07E0 Dc.w $07C0 Dc.w $1FF8 Dc.w $1FF0 Dc.w $3FEC Dc.w $3FF8 Dc.w $7FDE Dc.w $3FF8 Dc.w $7FBE Dc.w $7FFC Dc.w $FF7F Dc.w $7EFC Dc.w $FFFF Dc.w $7FFC Dc.w $FFFF Dc.w $3FF8 Dc.w $7FFE Dc.w $3FF8 Dc.w $7FFE Dc.w $1FF0 Dc.w $3FFC Dc.w $07C0 Dc.w $1FF8 Dc.w $0000 Dc.w $07E0 Dc.w $0000 Dc.w $0000 Last edited by E-Penguin; 06 January 2024 at 16:46. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pointer (Prefs) opening in new screen | levellord | support.AmigaOS | 4 | 03 November 2021 23:28 |
Busy wait for screen lines | Quagliarulo | Coders. Asm / Hardware | 5 | 18 July 2020 12:17 |
Screen tear/glitch following mouse pointer. | lordofchaos | support.WinUAE | 5 | 24 May 2019 20:03 |
Animated Busy Pointer Image | Leandro Jardim | request.Other | 1 | 23 May 2012 02:41 |
Mouse pointer jumps to centre of screen | ral-clan | support.WinUAE | 0 | 30 January 2011 02:41 |
|
|