Author Topic: Changing cursor color via script?  (Read 1043 times)

Hello,

I know how to make new cursors and set them and blah blah.

I was just wondering that, is it possible to change to color of the cursor(s)(bitmap) via script?

I have tried to:

Quote
MyCursor.setColor(%color);

But it doesn't change the color and just says that it's an unknown function. (setColor changes the color of any other bitmap though)

The name of the cursor is 3dcursor.bmp.

The name of the cursor is 3dcursor.bmp.

I have made my own cursor named something else and I can do things with it just fine.

Quote
new GuiCursor(MyCursor)
{
   hotSpot = "1 1";
   renderOffset = "0 0";
   bitmapName = "bitmappathhere";
};
Canvas.setCursor(MyCursor);

Hello,

I know how to make new cursors and set them and blah blah.

I was just wondering that, is it possible to change to color of the cursor(s)(bitmap) via script?

I have tried to:

But it doesn't change the color and just says that it's an unknown function. (setColor changes the color of any other bitmap though)

Because myCursor is not an ACTUAL bitmap. It is a GuiCursor..

Because myCursor is not an ACTUAL bitmap. It is a GuiCursor..

I didn't quite get this :o?

I didn't quite get this :o?


I'm not sure if this will work, but give it a shot..

myCursor.bitMap.setColor(%color);

I'm not sure if this will work, but give it a shot..

myCursor.bitMap.setColor(%color);


It says that it cannot find object "(BITMAPPATHHERE)" attempting to call function "setColor"

because bitmap isn't an object?

Try doing

myCursor.dump();

Try doing

myCursor.dump();

Quote
==>myCursor.dump();
Member Fields:
  bitmapName = "filepathhere"
  hotSpot = "1 1"
Tagged Fields:
  renderOffset = "0 0"
Methods:
  addScheduledEvent() -
  cancelEvents() -
  clearEvents() -
  clearNTObjectName() -
  delete() - obj.delete()
  dump() - obj.dump()
  dumpEvents() -
  getClassName() - obj.getClassName()
  getGroup() - obj.getGroup()
  getId() - obj.getId()
  getName() - obj.getName()
  getType() - obj.getType()
  processInputEvent() -
  save() - obj.save(fileName, <selectedOnly>)
  schedule() - object.schedule(time, command, <arg1...argN>);
  serializeEvent() -
  serializeEventToString() -
  SetEventEnabled() -
  setName() - obj.setName(newName)
  setNTObjectName() -
  ToggleEventEnabled() -

Doesn't look too good... D:?

So I guess this can't be done?

:c?

I think it is completely and absolutely possible, just by looking at one add-on: the crosshair GUI.
I know that it would take a lot of random stuff to set up, script-wise, but it would work perfectly in pretty much the same way. Now, I'm not sure if it would be possible to have little sliders for making the color, but it would be possible to have pre-set options.

I think it is completely and absolutely possible, just by looking at one add-on: the crosshair GUI.
I know that it would take a lot of random stuff to set up, script-wise, but it would work perfectly in pretty much the same way. Now, I'm not sure if it would be possible to have little sliders for making the color, but it would be possible to have pre-set options.
If you make it switch the 'bitmap' file then yes you could do this.