#include <irrlicht/irrlicht.h>
#include <libguile.h>
+#include "color.h"
#include "gui-in-out-fader.h"
#include "wrapped.h"
init_gui_in_out_fader_type, gui_in_out_fader_p,
wrap_gui_in_out_fader, unwrap_gui_in_out_fader);
+ SCM
+ irr_gui_IGUIInOutFader_setColor (SCM wrapped_in_out_fader,
+ SCM color,
+ SCM dest_color)
+ {
+ irr::gui::IGUIInOutFader* fader = unwrap_gui_in_out_fader (wrapped_in_out_fader);
+ if (scm_is_false (dest_color))
+ {
+ fader->setColor (scm_to_color (color));
+ }
+ else
+ {
+ fader->setColor (scm_to_color (color),
+ scm_to_color (dest_color));
+ }
+ return SCM_UNSPECIFIED;
+ }
+
}
return wrap_gui_font (font);
}
+ SCM
+ irr_gui_IGUISkin_setColor (SCM wrapped_gui_skin,
+ SCM which,
+ SCM new_color)
+ {
+ irr::gui::IGUISkin* skin = unwrap_gui_skin (wrapped_gui_skin);
+ skin->setColor (scm_to_default_color (which),
+ scm_to_color (new_color));
+ return SCM_UNSPECIFIED;
+ }
+
SCM
irr_gui_setFont (SCM wrapped_gui_skin,
SCM font,
DEFINE_GSUBR ("add-button!", 1, 1, 1, irr_gui_addButton);
DEFINE_GSUBR ("get-color", 1, 1, 0, irr_gui_getColor);
DEFINE_GSUBR ("get-font", 1, 1, 1, irr_gui_getFont);
+ DEFINE_GSUBR ("set-color!", 2, 1, 0, irr_gui_setColor);
DEFINE_GSUBR ("set-max!", 2, 0, 0, irr_gui_setMax);
DEFINE_GSUBR ("set-override-color!", 2, 0, 0, irr_gui_setOverrideColor);
}
}
}
+ SCM
+ irr_gui_setColor (SCM wrapped_obj,
+ SCM color,
+ SCM dest_color)
+ {
+ if (gui_image_p (wrapped_obj))
+ {
+ // Params: color
+ unwrap_gui_image (wrapped_obj)->setColor (scm_to_color (color));
+ return SCM_UNSPECIFIED;
+ }
+ else if (gui_in_out_fader_p (wrapped_obj))
+ {
+ // Params: color and dest_color (optional)
+ return irr_gui_IGUIInOutFader_setColor (wrapped_obj, color, dest_color);
+ }
+ else if (gui_skin_p (wrapped_obj) && !scm_is_false (dest_color))
+ {
+ // Params: which and new_color
+ return irr_gui_IGUISkin_setColor (wrapped_obj, color, dest_color);
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Cannot set color to object: ~S",
+ scm_list_1 (wrapped_obj), scm_list_1 (wrapped_obj));
+ }
+ }
+
SCM
irr_gui_setMax (SCM wrapped_obj,
SCM max)