About This File
Hello,
I thought it would be a opportunity to introduce some basic scaleform scripts that would help out some users with their development aka. use less CEF for simple stuff.
This resource introduces the ability to give button instructions that supports controls (Meaning it'll detect your input whether its a gamepad or keyboard...).
API
- You can always have a look at the Controls to get their ID.
- Using the resource is very simple to use and it supports different uses of customization:
- You can adjust style between Horizontal (1) and Vertical (-1)
- You can adjust background color with RGBA (Note you'll need to add it in array form) or HEX.
- Bulk support for buttons.
new hud(style, color) /* * style: -1 for horizontal view, 1 for vertical view * color: HEX or RGBA [255, 255, 255, 255] */
hudClassInstance.addButton(title, controlID); /* * title: any text * controlID: you can find a list of controlID on wiki */ hudClassInstance.addButtons({ anyName: controlID1, anyName2: controlID2 }); /* * Bulk support for adding buttons */ hudClassInstance.removeButton(titleOrControlID); /* * titleOrControlID: remove button by its title or controlID */ hudClassInstance.removeButton(titleOrControlID); /* * removes all buttons */ hudClassInstance.toggleHud(state); /* * state: Boolean toggling visibility */ hudClassInstance.changeStyle(style); /* * style: -1 for horizontal and 1 for vertical */ hudClassInstance.setBackgroundColor(color); /* * color: HEX string or RGBA Array */ hudClassInstance.changeButtonTitle(index, newTitle); /* * index: controlID or currentButton title. (if custom button you can type its name t_buttonName) * newTitle: string */ hudClassInstance.changeButtonControl(index, newControl); /* * index: controlID or currentButton title. (if custom button you can type its name t_buttonName) * newControl: controlID or custom control (t_buttonName) */
If you have any issues, you know as usual contact me on Forums or discord. Any suggestions please add it in your review. If you liked the resource show me your support to produce some useful resources in the future.
What's New in Version 1.1.0 See changelog
Released
- Fixed of scaleform using old instance design if using new instance of class.
- Added changeButtonTitle(index, title) Index: get button's index using its current title or control. title: button's new title
- Added changeButtonControl(index, control) Index: get button's index using its current title or control. control: use control ids or use custom buttons t_customButton
- Added support for custom buttons t_customButton.
- Improved the overall class core.