image
New(a)
src.alpha=a
..()
image/One=image('icon.dmi',locate(1,1,1),"state",20)
Problem description:
I want to assign some image objects an alpha value upon creation what am I doing wrong
ID:1724894
Nov 22 2014, 6:52 am (Edited on Nov 23 2014, 12:09 am)
(See the best response by Mightymo.)
|
|
Code:
image Problem description: I want to assign some image objects an alpha value upon creation what am I doing wrong |
Nov 22 2014, 7:07 am
Best response
|
|
You have to explicitly call new.
|
Sorry I made a mistake I meant src.alpha=a
So when I call new I can pass the alpha there But I fear that this way I am ruining the default new/image parameters. I just want to add a var for alpha upon creation.So I can pass alpha value from the new proc |
In response to Victorqr
|
|
Just allow for all of the arguments. If you don't want to ruin the default image, consider deriving a type.
image |
Unless this was changed recently, /image/New() and /proc/image() cannot be sanely overridden.
Though before we even get to that, it seems extremely strange to need to set a default alpha value upon creation for all /image's. You probably want to do something like this instead: image/One=image('icon.dmi',locate(1,1,1),"state",20) |