Difference between revisions of "Event.new"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === <br /> Creates a new `Event` object to be dispatched from an `EventDispatcher`.<br /> <br /> <source l...")
 
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 +
'''Class:''' [[Event]]<br/>
 +
 
=== Description ===
 
=== Description ===
<br />
+
Creates a new '''Event''' object to be dispatched from an EventDispatcher.
Creates a new `Event` object to be dispatched from an `EventDispatcher`.<br />
+
<syntaxhighlight lang="lua">
<br />
+
(any), (any) = Event.new(type)
<source lang="lua">
+
</syntaxhighlight>
(any) (any), = Event.new(type,)
+
 
</source>
+
=== Parameters ===
'''type:''' (string) ''''''<br/>
+
'''type''': (string)<br/>
'''Returns''' (any) New `Event` object.<br/>
+
 
'''Returns''' (any) New `Event` object.<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 02: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)