You can do it with metamethods. See the "__newindex" example in the docs:
http://www.hollywood-mal.com/docs/html/ ... prMM_.html
Search found 692 matches
- Sun Mar 30, 2025 7:50 pm
- Forum: Wishlist
- Topic: ProtectTable() command which would prevent more variables being added
- Replies: 3
- Views: 419
- Tue Mar 18, 2025 2:54 pm
- Forum: Hollywood bugs
- Topic: InvertPalette doesn't work correctly
- Replies: 1
- Views: 433
InvertPalette doesn't work correctly
InvertPalette() doesn't seem to work correctly. It changes colors to ARGB values instead of RGB or something like that. CreatePalette(1, #PALETTE_MONOCHROME) t = GetAttribute(#PALETTE, 1, #ATTRPALETTE) DebugPrint(HexStr(t[0]), HexStr(t[1])) InvertPalette(1) t = GetAttribute(#PALETTE, 1, #ATTRPALETTE...
- Tue Mar 18, 2025 2:48 pm
- Forum: Hollywood bugs
- Topic: SetClipboard doesn't work with palette brushes
- Replies: 1
- Views: 593
SetClipboard doesn't work with palette brushes
I get a hit in the MorphOS debug log if I try to use SetClipboard() with a palette brush, and the resulting image is always a solid wrongly colored image (if you check from the Clipboards dir, for example).
Code: Select all
CreateBrush(1, 200, 100, #RED, {Palette=#PALETTE_AGA})
SetClipboard(#CLIPBOARD_IMAGE, 1)
- Mon Mar 17, 2025 2:26 pm
- Forum: Newbie questions
- Topic: Understanding the typical hollywood loop
- Replies: 14
- Views: 14769
Re: Understanding the typical hollywood loop
But if I try to make an option in the paint program to draw a transparent it will draw a it with dots along the line whenever a new line takes over from the previous piece of the line. Line(oldx, oldy, newx, newy, COLOUR, {Transparency = transparencyvariable, Thickness = R}) Is there a way to avoid...
- Thu Mar 13, 2025 6:26 pm
- Forum: Hollywood bugs
- Topic: Some brushes are reported to have 0 bits depth
- Replies: 1
- Views: 390
Some brushes are reported to have 0 bits depth
In some cases GetAttribute() reports brush depth as 0 bits. The documentation tells "Returns the depth of the brush. If this is less than or equal to 8, the brush is a palette brush." So, I was detecting brushes as palette brushes if their depth was less than 9, but got issues because some...
- Thu Mar 13, 2025 6:17 pm
- Forum: Hollywood bugs
- Topic: Some brush library functions crash with palette brushes
- Replies: 1
- Views: 498
Some brush library functions crash with palette brushes
I haven't tried all similar functions, so it might affect to others too, but at least PerspectiveDistortBrush() and PolarDistortBrush() crash the whole Hollywood application if I use the "smooth" option with palette based images. Functions do work fine if that option isn't enabled. I've te...
- Wed Mar 12, 2025 7:07 pm
- Forum: Newbie questions
- Topic: safe to use enablelinehook/disablelinehook twice in a row?
- Replies: 2
- Views: 611
Re: safe to use enablelinehook/disablelinehook twice in a row?
I really would fix the code instead, and organize it better. DisableLineHook() should only be used briefly and controlled way. If you're branching out from functions without returning them later to get things finished, you'll may get all other kind of issues too. Running out of stack etc..
- Sat Mar 08, 2025 11:18 am
- Forum: Wishlist
- Topic: MakeButton to return ID also when ID is given
- Replies: 4
- Views: 1616
- Wed Mar 05, 2025 6:15 pm
- Forum: General programming
- Topic: Any way deleting item from a table when only var containing it is known?
- Replies: 2
- Views: 744
Re: Any way deleting item from a table when only var containing it is known?
ItemVar = Mytable[n] If Mytable[n] isn't a sub-table, there's no way to find relationship between ItemVar and it. If Mytable[n] contains a string, number, or any other kind of data that is not a table, ItemVar stores an independent copy of the data from Mytable[n]. If you delete the whole Mytable t...
- Tue Mar 04, 2025 2:12 pm
- Forum: General programming
- Topic: Does FreeBrush frree Brush immediatelly?
- Replies: 3
- Views: 2057
Re: Does FreeBrush frree Brush immediatelly?
FreeBrush() frees the brush data from memory immediately, so in that loop you're having only one brush in memory at once. The local ID variable is being replaced on every round and memory reserved for the previous ID value is freed by the garbage collector at some point, but it's not that many bytes...