Difference between revisions of "Event.new"

From GiderosMobile
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/Event|Event]]<br/>
+
'''Class:''' [[Event]]<br/>
=== <translate>Description</translate> ===
+
 
<translate><br />
+
=== Description ===
Creates a new [[Special:MyLanguage/Event|Event]] object to be dispatched from an [[Special:MyLanguage/EventDispatcher|EventDispatcher]].<br />
+
Creates a new '''Event''' object to be dispatched from an EventDispatcher.
<br /></translate>
+
<syntaxhighlight lang="lua">
<source lang="lua">
 
 
(any), (any) = Event.new(type)
 
(any), (any) = Event.new(type)
</source>
+
</syntaxhighlight>
=== <translate>Parameters</translate> ===
+
 
'''type''': (string) <translate></translate> <br/>
+
=== Parameters ===
=== <translate>Return values</translate> ===
+
'''type''': (string)<br/>
'''<translate>Returns</translate>''' (any) <translate>New [[Special:MyLanguage/Event|Event]] object.</translate><br/>
+
 
'''<translate>Returns</translate>''' (any) <translate>New [[Special:MyLanguage/Event|Event]] object.</translate><br/>
+
=== Return values ===
 +
'''Returns''' (any) new Event object<br/>
 +
'''Returns''' (any) new Event object<br/>
 +
 
 +
=== Example ===
 +
'''User created event'''
 +
<syntaxhighlight lang="lua">
 +
local event = Event.new("myevent")
 +
event.data1 = "12345"
 +
event.data2 = "abcde"
 +
mydispatcher:dispatchEvent(event)
 +
</syntaxhighlight>
 +
 
 +
{{Event}}

Latest revision as of 01:14, 18 November 2023

Available since: Gideros 2011.6
Class: Event

Description

Creates a new Event object to be dispatched from an EventDispatcher.

(any), (any) = Event.new(type)

Parameters

type: (string)

Return values

Returns (any) new Event object
Returns (any) new Event object

Example

User created event

local event = Event.new("myevent")
event.data1 = "12345"
event.data2 = "abcde"
mydispatcher:dispatchEvent(event)