Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// @function draw_ethereal_text(x, y, text)
- /// @param {real} x X position to start drawing
- /// @param {real} y Y position to start drawing
- /// @param {string} text Text to animate
- /// @description Creates a rainbow, floating text effect with triple shadow
- function draw_ethereal_text(xx, yy, text) {
- var t = current_time/500; // Time variable for animation
- var len = string_length(text); // Get actual text length
- // Save previous blend mode and alpha
- var prev_blend = gpu_get_blendmode();
- var prev_alpha = draw_get_alpha();
- // Setup additive blending for glow effect
- gpu_set_blendmode(bm_add);
- // Draw three layers of floating text
- for(var p = 3; p--; ) {
- // Draw each character
- for(var i = len; i--; ) {
- // Create rainbow color cycling
- draw_set_color(make_color_hsv(
- (t*100 + i*20 + p*85) % 256, // Hue cycles over time
- 255, // Full saturation
- 255 // Full value
- ));
- // Set transparency for glow effect
- draw_set_alpha(0.3);
- // Draw character with wave motion
- draw_text(
- xx + i*20 + sin(t + i/2)*15 + p*2, // X with wave
- yy + cos(t*2 + i/3)*10 + p*2, // Y with wave
- string_char_at(text, i+1)
- );
- }
- }
- // Restore previous state
- gpu_set_blendmode(prev_blend);
- draw_set_alpha(prev_alpha);
- }
- // Example usage:
- // draw_ethereal_text(room_width/2, room_height/2, "Lost and found");
- // draw_ethereal_text(mouse_x, mouse_y, "Within without");
Advertisement
Add Comment
Please, Sign In to add comment