// This is a letter from the scrolly message. It appears off the right of the screen and then scrolls left and disappears.
// Exciting stuff.

#define SCROLLY_MESSAGE_LETTER_VELOCITY		-768

#define current_menu_entity_id			v0
#define base_sin_counter			v5

	let base_sin_counter = 0

	let draw_order = MENU_TEXT_DRAW_ORDER

	// We have it as a permanent entity type because
	let entity_type = ENT_TYPE_PERMANENT_MENU_ENTITY

	let opengl_booleans = opengl_boolean_blend_add

	let entity_type = ENT_TYPE_PERMANENT_MENU_ENTITY

	let draw_mode = DRAW_MODE_SPRITE

	let sprite = font[arb]

	let bitshift = 8
	let x_vel = SCROLLY_MESSAGE_LETTER_VELOCITY

	let world_y = SCROLLING_MESSAGE_Y_CO_ORD

	set_private_co_ords

start

	let current_menu_entity_id = GET_GLOBAL_FLAG (menu_entity_identity_flag)

	if current_menu_entity_id != CONST_UNSET then
		if current_menu_entity_id.signal & SLEEP_SCROLLY then
			// Fade out...
			goto fade_out
		end_if
	end_if

	gosub death_check

end



.fade_out

	let opengl_booleans = opengl_boolean_blend_add + opengl_boolean_vertex_colour_alpha

start

	let opengl_vertex_alpha = get_global_flag (scrolling_message_synced_alpha)

	if opengl_vertex_alpha = 0 then
		kill_entity own_id
	end_if

	gosub death_check

end

.death_check

	if world_x < -40 then
		kill_entity own_id
	end_if

return

