unreal.RazerChromaFunctionLibrary¶
- class unreal.RazerChromaFunctionLibrary(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
BlueprintFunctionLibraryFunction library for Razer Chroma devices.
This function library is the main way that your gameplay code will likley interact with the Razer Chroma API to play animations or set any custom effects
C++ Source:
Plugin: RazerChromaDevices
Module: RazerChromaDevices
File: RazerChromaFunctionLibrary.h
- classmethod conv_razer_chroma_device_types_to_string(device_types) str¶
Converts a ERazerChromaDeviceTypes enum to string.
- Parameters:
device_types (int32)
- Return type:
- classmethod get_total_duration(anim) float¶
Returns the duration in seconds of the specified animation.
- Parameters:
anim (RazerChromaAnimationAsset)
- Return type:
- classmethod is_animation_playing(anim) bool¶
Returns true if the given animation is currently playing.
- Parameters:
anim (RazerChromaAnimationAsset)
- Return type:
- classmethod is_chroma_animation_paused(anim) bool¶
Returns true if the given animation is currently paused.
- Parameters:
anim (RazerChromaAnimationAsset)
- Return type:
- classmethod is_chroma_runtime_available() bool¶
Returns true if the Razer Chroma runtime libraries are currently available.
This will be false on any machines that do not have Razer Chroma installed on them, and thus cannot set any Razer Chroma effects.
- Return type:
- classmethod pause_chroma_animation(anim_to_pause) None¶
Pauses the given animation if it is currently playing
- Parameters:
anim_to_pause (RazerChromaAnimationAsset)
- classmethod play_chroma_animation(anim_to_play, looping=False) bool¶
Attempts to play the given Chroma animation file.
If the Chroma Runtime is not available, nothing will happen.
- Parameters:
anim_to_play (RazerChromaAnimationAsset) – The Razer Chroma animation asset.
looping (bool) – If true, this animation will loop (start re-playing after it finishes)
- Returns:
True if successfully played, false otherwise.
- Return type:
- classmethod resume_chroma_animation(anim_to_resume, loop) None¶
Resumes the given animation if it has been paused.
- Parameters:
anim_to_resume (RazerChromaAnimationAsset) – The animation to resume.
loop (bool) – If true, this animation will loop (start re-playing after it finishes)
- classmethod set_all_devices_static_color(color_to_set, device_types) None¶
Sets the color of every connected Razer Chroma Device to this static color
- Parameters:
color_to_set (Color) – The color to set the devices to (the alpha channel is not used)
device_types (int32) – Which types of razer devices you would like to set the color on if they are available
- classmethod set_event_name(name) int32¶
Name the Chroma event to add extras like haptics to supplement the event
- Parameters:
name (str) – Empty string will stop haptic playback * Name specifies an identifier that adds extras to game events like haptics
- Return type:
int32
- classmethod set_idle_animation(new_idle_animation) None¶
Sets the idle animation for this application. This animation will play if no other animations are playing at the moment.
By default, the idle animation is set via the project settings, but it can be changed at runtime.
- Parameters:
new_idle_animation (RazerChromaAnimationAsset)
- classmethod set_use_idle_animation(use_idle_animation) None¶
Sets whether or not we should use an idle currently an animation
- Parameters:
use_idle_animation (bool)
- classmethod stop_chroma_animation(anim_to_stop) None¶
Stops the given Chroma Animation if it is currently playing.
- Parameters:
anim_to_stop (RazerChromaAnimationAsset)
- classmethod use_forward_chroma_events(toggle) None¶
On by default, UseForwardChromaEvents sends the animation name to SetEventName
automatically when PlayAnimationName is called.
- Parameters:
toggle (bool) – If true, PlayAnimation calls will pass the animation note to SetEventName. * If false, PlayAnimation will not invoke SetEventName.