Custom Mouse Pointers (Amiga)

Find quick help here to get you started with Hollywood
oceanarts
Posts: 111
Joined: Mon May 27, 2024 10:42 pm

Custom Mouse Pointers (Amiga)

Post by oceanarts »

How exactly do custom mouse pointers work on the Amiga end?
Alpha channels seem to be accepted, but the colors are all wrong.
Development System : Imac G5, MorphOs 3.19
plouf
Posts: 691
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Custom Mouse Pointers (Amiga)

Post by plouf »

mouse pointer in amigaos is pallete based in OS level
hollywood remaps to pallete which choose some collors
traditional if you have a 32bit brush and remap it to 256 or even 16 colors you loose traspancy because of dithering

an example or at least the "faulty" brush would help

but ideal in amigaOS you should use pallete brushes
Christos
oceanarts
Posts: 111
Joined: Mon May 27, 2024 10:42 pm

Re: Custom Mouse Pointers (Amiga)

Post by oceanarts »

I see.
Is this the case for all Amiga platforms, such as OS4.x, Aros etc too?
Not able to test on these currently.
Development System : Imac G5, MorphOs 3.19
oceanarts
Posts: 111
Joined: Mon May 27, 2024 10:42 pm

Re: Custom Mouse Pointers (Amiga)

Post by oceanarts »

Looks like I can't get acceptable colors even if I use indexed images.
Development System : Imac G5, MorphOs 3.19
plouf
Posts: 691
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Custom Mouse Pointers (Amiga)

Post by plouf »

provide example code and brush
so eveyrone can test/check/suggest
Christos
oceanarts
Posts: 111
Joined: Mon May 27, 2024 10:42 pm

Re: Custom Mouse Pointers (Amiga)

Post by oceanarts »

Here's a video clip showing the issue:
https://ody.sh/SLP3H460bQ

The relevant code:

Code: Select all

@BRUSH 1, "mouse_idle.png", {LoadAlpha = True}
CreatePointer(1, #BRUSH, 1, 0, 0)
@BRUSH 2, "mouse_active.png", {LoadAlpha = True}
CreatePointer(2, #BRUSH, 2, 0, 0)
and
SetPointer(x)
as needed.

If it's indexed I set the LoadAlpha to False.
Development System : Imac G5, MorphOs 3.19
User avatar
jPV
Posts: 743
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Custom Mouse Pointers (Amiga)

Post by jPV »

From the CreatePointer() documentation:
Please note that not all systems can handle true colour mouse pointers. If the system does not support true colour mouse pointers, Hollywood will reduce the colors. Also, your image data might get scaled because some systems impose limits on the maximum mouse pointer size.

On AmigaOS 3, CreatePointer() also supports palette brushes and sprites. Pointers on classic Amiga hardware are always palette-based because they are implemented using hardware sprites so if you pass palette brushes or sprites to CreatePointer() on AmigaOS 3 you have full control over the exact pens used by the pointer which is more convenient than using 32-bit graphics because those will first have to be mapped down to palette graphics on AmigaOS 3 and you won't have any control over the palette pens in the remapped brush or sprite.
It's a bit difficult situation, because in the optimal situation you should know what colors are set on which pens in the system you're running the program on, and create a palette image using those pens. First eight or so pens are pretty static on Amiga setups, but not always... first four are the safest bet. And then there might be a graphics card (RTG) setup on Amiga, and many older graphics chips from that age didn't support many colors on their hardware sprite. IIRC Virge/Voodoo/etc. did only support four colors sprite, where one color was transparency, one was inversed, and there were actually only two real colors. So, it could be a bit messy to touch the pointer at all :)
Last edited by jPV on Mon Jun 17, 2024 9:01 am, edited 1 time in total.
User avatar
jPV
Posts: 743
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Custom Mouse Pointers (Amiga)

Post by jPV »

oceanarts wrote: Fri Jun 14, 2024 5:05 pm I see.
Is this the case for all Amiga platforms, such as OS4.x, Aros etc too?
Not able to test on these currently.
I haven't tested either, but I'm pretty sure these systems do support true color pointers. At least on MorphOS pointer images are PNG images with alpha transparency in OS level. Although if you're using an old graphics card (like Voodoo3/4/5) then it's most likely limited... but majority of users have more modern graphics cards in the next generation systems.
oceanarts
Posts: 111
Joined: Mon May 27, 2024 10:42 pm

Re: Custom Mouse Pointers (Amiga)

Post by oceanarts »

Hmm.,, Guess I will have to forego the custom pointer then. Unless there's a way to hide the pointer while still accepting input and replace it with a Hollywood brush. But I guess the size issue would still be a problem.
Development System : Imac G5, MorphOs 3.19
plouf
Posts: 691
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Custom Mouse Pointers (Amiga)

Post by plouf »

oceanarts wrote: Mon Jun 17, 2024 11:00 am .... Unless there's a way to hide the pointer while still accepting input and replace it with a
you can HidePointer() does that...
ideal however in amiga side probably would be the HidePointer() Entry in combination of FullScreen, .....
Christos
Post Reply