https://wiki.gideros.rocks/api.php?action=feedcontributions&user=Hgy29&feedformat=atomGiderosMobile - User contributions [en-gb]2024-03-19T07:57:42ZUser contributionsMediaWiki 1.35.11https://wiki.gideros.rocks/index.php?title=Sprite:setStencilOperation&diff=22774Sprite:setStencilOperation2023-10-27T07:04:58Z<p>Hgy29: </p>
<hr />
<div>__NOTOC__<br />
'''Available since:''' Gideros 2017.6<br/><br />
'''Class:''' [[Sprite]]<br/><br />
<br />
=== Description ===<br />
Allows to set a stencil operation to be used when drawing this sprite.<br />
<syntaxhighlight lang="lua"><br />
Sprite:setStencilOperation(op)<br />
</syntaxhighlight><br />
<br />
<br />
The '''op''' table can contain the following fields:<br />
*'''stencilClear''': (boolean) whether the stencil should be cleared beforehand<br />
*'''stencilMask''': (integer) the mask value used in stencil operations<br />
*'''stencilWriteMask''': (integer) the mask value used when writing to stencil<br />
*'''stencilClearValue''': (integer) the value used to fill then stencil when clearing<br />
*'''stencilRef''': (integer) the reference value used in stencil operations<br />
*'''stencilFunc''': (integer) the stencil function to use<br />
*'''stencilFail''': (integer) the stencil operation when stencil test failed<br />
*'''depthFail''': (integer) the stencil operation when depth test failed<br />
*'''depthPass''': (integer) the stencil operation when depth test has passed<br />
*'''depthMask''': (boolean) whether depth buffer should be written or not (true by default)<br />
<br />
Stencil function and operations code are defined in Sprite.STENCIL_xxx fields and correspond to the GL_xxx relevant values in OpenGL stencil documentation https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glStencilFunc.xhtml.<br />
<br />
=== Parameters ===<br />
'''op''': (table) a table containing the stencil operation settings, or nil to disable stencil<br />
<br />
=== Example ===<br />
'''A glowing ticket effect''':<br />
<syntaxhighlight lang="lua"><br />
-- STENCILOPERATION @hgy29<br />
local bg = Bitmap.new(Texture.new("gfx/vip/background.png"))<br />
local ticket = Bitmap.new(Texture.new("gfx/vip/ticket.png"))<br />
local text = Bitmap.new(Texture.new("gfx/vip/text.png"))<br />
local fx1 = Bitmap.new(Texture.new("gfx/vip/fx1.png"))<br />
local fx2 = Bitmap.new(Texture.new("gfx/vip/fx2.png"))<br />
<br />
stage:addChild(bg) bg:setScale(0.5)<br />
stage:addChild(ticket) ticket:setPosition(80,20) ticket:setScale(0.5)<br />
ticket:addChild(fx1) fx1:setX(-100)<br />
fx1:addChild(fx2) fx2:setX(-100)<br />
ticket:addChild(text)<br />
<br />
-- Use auto layout on ticket to center text automatically<br />
ticket:setLayoutParameters{ rowWeights = {1}, columnWeights = {1} }<br />
text:setLayoutConstraints{}<br />
<br />
-- Use stencil for masking glow:<br />
-- 1) Clear stencil and set it to '1' for every pixel drawn on 'ticket'<br />
ticket:setStencilOperation{<br />
stencilClear = true, stenciMask = 1, stencilWriteMask = 1, stencilRef = 1,<br />
stencilFunc = Sprite.STENCIL_ALWAYS, depthPass = Sprite.STENCIL_REPLACE<br />
}<br />
--2) Only draw fx1/fx2 if stencil isn't 0<br />
fx1:setStencilOperation{<br />
stencilClear = false, stencilMask = 1, stencilRef = 0,<br />
stencilFunc = Sprite.STENCIL_NOTEQUAL<br />
}<br />
<br />
local dir = 1<br />
stage:addEventListener(Event.ENTER_FRAME, function()<br />
if fx1:getX() > 450 then dir = -1<br />
elseif fx1:getX() < -100 then dir = 1<br />
end<br />
fx1:setX(fx1:getX() + dir*5)<br />
end)<br />
</syntaxhighlight><br />
<br />
{{Sprite}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Application:set&diff=22773Application:set2023-10-27T07:00:27Z<p>Hgy29: /* Compatibility table */</p>
<hr />
<div>__NOTOC__<br />
'''Available since:''' Gideros 2015.7<br/><br />
'''Class:''' [[Application]]<br/><br />
<br />
=== Description ===<br />
Sets the state of the desktop setting provided as string parameter.<br />
<syntaxhighlight lang="lua"><br />
application:set(setting, value)<br />
</syntaxhighlight><br />
<br />
<br />
'''new''' Gideros 2022.1: implement '''application:set("wintabMode")'''<br />
<br />
=== Parameters ===<br />
'''setting''': (string) the desktop setting<br/><br />
'''value''': (varies) the new setting value(s)<br/><br />
<br />
=== '''Compatibility table''' ===<br />
{| class="wikitable" style="text-align: center;"<br />
!!!QT!!Win32!!UWP!!Android!!Apple MacOS!!Apple iOS!!Apple tvOS!!Linux!!HTML<br />
|-<br />
|clipboard||X||X||||||||||||X||<br />
|-<br />
|cursor||X||X||X||||X||||||X||X<br />
|-<br />
|cursorPosition||X||X||||||||||||||<br />
|-<br />
|documentDirectory||X||X||||||||||||X||<br />
|-<br />
|maximumSize||X||||||||||||||||<br />
|-<br />
|minimumSize||X||||||||||||||||<br />
|-<br />
|mkDir||X||X||||||||||||X||<br />
|-<br />
|statusBar||||||||X||||X||||||<br />
|-<br />
|temporaryDirectory||X||X||||||||||||X||<br />
|-<br />
|windowColor||X||||||||||||||||<br />
|-<br />
|windowModel||X||||||||||||||||<br />
|-<br />
|windowPosition||X||X||||||||||||X||<br />
|-<br />
|windowSize||X||X||||||||||||X||<br />
|-<br />
|windowTitle||X||X||||||||||||X||X<br />
|-<br />
|wintabMode||X||||||||||||||||<br />
|}<br />
<br />
=== List of available parameters and settings ===<br />
To get a list of parameters that can be set use:<br />
<syntaxhighlight lang="lua"><br />
print(application:set("help"))<br />
--[[<br />
- windowPosition(x,y)<br />
- windowSize(w,h)<br />
- minimumSize(w,h)<br />
- maximumSize(w,h)<br />
- windowColor(r,g,b)<br />
- windowTitle(text)<br />
- windowModel(type//help)<br />
- cursor(type//help)<br />
- cursorPosition(x,y)<br />
- clipboard(text)<br />
- mkdir(path|dirName//help)<br />
- documentDirectory(path)<br />
- temporaryDirectory(path)<br />
]]<br />
</syntaxhighlight><br />
<br />
To get help for individual settings use:<br />
<syntaxhighlight lang="lua"><br />
print(application:set("cursor","help")) -- eg: cursor<br />
--[[<br />
Accepted value for cursor :<br />
- arrow<br />
- upArrow<br />
- cross<br />
- wait<br />
- IBeam<br />
- sizeVer<br />
- sizeHor<br />
- sizeBDiag<br />
- sizeFDiag<br />
- sizeAll<br />
- blank -- not available on win32<br />
- splitV<br />
- splitH<br />
- pointingHand<br />
- forbidden<br />
- whatsThis<br />
- busy<br />
- openHand -- not available on win32<br />
- closedHand -- not available on win32<br />
- dragCopy -- not available on win32<br />
- dragMove -- not available on win32<br />
- dragLink -- not available on win32<br />
]]<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="lua"><br />
print(application:set("windowModel","help")) -- eg: window mode<br />
--[[<br />
Accepted value for windowModel :<br />
- reset<br />
- stayOnTop<br />
- stayOnBottom<br />
- frameless<br />
- noTitleBar<br />
- noButton<br />
- onlyMinimize<br />
- onlyMaximize<br />
- onlyClose<br />
- noMinimize<br />
- noMaximize<br />
- noClose<br />
- helpButton<br />
]]<br />
</syntaxhighlight><br />
<br />
=== Examples ===<br />
<syntaxhighlight lang="lua"><br />
application:set("windowPosition", 64, 64)<br />
application:set("windowColor", 0, 0, 0)<br />
application:set("windowTitle", "My lovely window title")<br />
application:set("cursor", "openHand")<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="lua"><br />
-- global app size<br />
myappleft, myapptop, myappright, myappbot = application:getLogicalBounds()<br />
myappwidth, myappheight = myappright - myappleft, myappbot - myapptop<br />
<br />
if application:getDeviceInfo() == "Windows" and not application:isPlayerMode() then<br />
application:set("windowPosition", myappwidth * 1.2, 16)<br />
application:set("windowModel", "onlyClose")<br />
-- application:set("windowModel", "noMaximize") -- doesn't work for me!<br />
application:set("windowTitle", "App Title")<br />
application:set("minimumSize", myappwidth, myappheight)<br />
application:set("maximumSize", myappwidth, myappheight)<br />
application:set("windowColor", 0, 0, 0)<br />
end<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="lua"><br />
application:set("mkDir", application:get("directory","executable").."|dirName")<br />
</syntaxhighlight><br />
<br />
{{Application}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=MediaWiki:Sidebar&diff=22569MediaWiki:Sidebar2023-09-22T06:08:46Z<p>Hgy29: </p>
<hr />
<div><br />
** Special:MyLanguage/Welcome!|mainpage-description<br />
** Special:RecentChanges|recentchanges<br />
** Special:Random|randompage<br />
** https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents|help<br />
<br />
* SEARCH<br />
* TOOLBOX<br />
* LANGUAGES</div>Hgy29https://wiki.gideros.rocks/index.php?title=MediaWiki:Sidebar&diff=22568MediaWiki:Sidebar2023-09-22T06:08:10Z<p>Hgy29: </p>
<hr />
<div>* navigation<br />
** Welcome|Welcome<br />
** Downloads|Downloads<br />
** Help|Contact and Help<br />
<br />
** Special:MyLanguage/Welcome!|mainpage-description<br />
** Special:RecentChanges|recentchanges<br />
** Special:Random|randompage<br />
** https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents|help<br />
<br />
* SEARCH<br />
* TOOLBOX<br />
* LANGUAGES</div>Hgy29https://wiki.gideros.rocks/index.php?title=File:3D-Maze-Pebble.GApp&diff=22524File:3D-Maze-Pebble.GApp2023-09-15T09:40:09Z<p>Hgy29: </p>
<hr />
<div></div>Hgy29https://wiki.gideros.rocks/index.php?title=Welcome!&diff=22522Welcome!2023-09-15T09:34:16Z<p>Hgy29: /* GIDEROS PEBBLES */</p>
<hr />
<div>__NOTOC__<br />
== '''GIDEROS API REFERENCES''' ==<br />
{|-<br />
|style="width: 33%;"|<br />
::::::::::::<br />
==='''[[Lua API]]'''===<br />
=== ''' &nbsp; ''' ===<br />
<br />
|style="width: 33%;"|<br />
::::::::::::<br />
==='''[[Main API]]'''===<br />
=== ''' &nbsp; ''' ===<br />
<br />
|style="width: 33%;"|<br />
::::::::::::<br />
==='''[[Plugins]]'''===<br />
=== ''' &nbsp; ''' ===<br />
|}<br />
<br />
== '''GIDEROS GUIDES AND TUTORIALS''' ==<br />
{|-<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Tutorials ===<br />
[[Lua to Luau conversion guide]]<br/><br />
[[Start Here|You can start here]]<br/><br />
[[Article Tutorials]]<br/><br />
[[Video Tutorials]]<br/><br />
<br />
=== From the Forum ===<br />
[[Examples|Forum Snippets and more...]]<br/><br />
[[ImGui Examples|ImGui Snippets]]<br/><br />
<br />
=== Links ===<br />
[[Made With Gideros]]<br/><br />
[[Developer YouTube Channels|Developers YouTube Channels]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Ultimate Guide ===<br />
[[Introduction]]<br/><br />
[[Gideros Studio]]<br/><br />
[[Getting Started]]<br/><br />
[[Gideros Player]]<br/><br />
[[Your first code]]<br/><br />
[[Introduction to Lua]]<br/><br />
[[Classes in Gideros]]<br/><br />
[[Scene Management]]<br/><br />
[[Introduction to Graphics]]<br/><br />
[[Introduction to Graphics Shapes]]<br/><br />
[[Introduction to Fonts]]<br/><br />
[[Playing Sound and Music]]<br/><br />
[[Event system]]<br/><br />
[[File system]]<br/><br />
[[Profiling]]<br/><br />
[[Hardware and OS]]<br/><br />
[[Exporting to a Player|Exporting your project ('''Xbox, ...''')]]<br/><br />
[[Making a Plugin]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Latest ===<br />
[[Latest Release|Latest Gideros]]<br/><br />
[[Latest Luau]]<br/><br />
|}<br />
<br />
== '''GIDEROS SHORTS''' ==<br />
[[Short-Issue-1|#1 - June 2023 - Overheat]]<br />
<br />
== '''GIDEROS PEBBLES''' ==<br />
[[Lua Shaders Pebbles|Lua Shaders]]</br><br />
[[3D Pebbles|3D]]</br><br />
<br />
== '''GIDEROS 2D HELPERS''' ==<br />
{|-<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== UI Classes ===<br />
[[UI Buttons|UI Buttons]]<br/><br />
[[UI Color Picker|UI Color Picker]]<br/><br />
[[UI Scrollable List|UI Scrollable List]]<br/><br />
[[UI Slider|UI Sliders]]<br/><br />
[[UI Text|UI Text]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Game Helpers ===<br />
[[Scene Manager|Scene Manager/Easing]]<br/><br />
[[Game Camera]]<br/><br />
[[Animated Sprite Factory|Animations (Sprite Sheets)]]<br/><br />
[[Mobile Controls]]<br/><br />
[[Tiled Map Editor|Tiled]]<br/><br />
[[CBump Template|CBump Template]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Plugins Helpers ===<br />
[[Media Plugin]]<br/><br />
|}<br />
<br />
== '''GIDEROS 3D HELPERS''' ==<br />
{|-<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== ReactPhysics3D ===<br />
[[3D Plane]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
|}<br />
<br />
== '''GIDEROS ADVANCED''' ==<br />
{|-<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Advanced ===<br />
[[Writing Shaders]]<br/><br />
''[[Lua Shaders]]''<br/><br />
[[Compiling Gideros Source]]<br/><br />
[[Compiling Gideros Luau Source|Compiling Gideros Luau '''WIP''']]<br/><br />
[[What Does What]]<br/><br />
[[Helping With Documentation]]<br/><br />
[[CPlusPlus for Gideros Studio Help]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Wiki Special Links ===<br />
[[Special:AllPages]]<br/><br />
[[All Classes and more]]<br/><br />
[[Wiki Sandbox]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
|}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Welcome!&diff=22519Welcome!2023-09-15T09:31:44Z<p>Hgy29: /* GIDEROS PEBBLES */</p>
<hr />
<div>__NOTOC__<br />
== '''GIDEROS API REFERENCES''' ==<br />
{|-<br />
|style="width: 33%;"|<br />
::::::::::::<br />
==='''[[Lua API]]'''===<br />
=== ''' &nbsp; ''' ===<br />
<br />
|style="width: 33%;"|<br />
::::::::::::<br />
==='''[[Main API]]'''===<br />
=== ''' &nbsp; ''' ===<br />
<br />
|style="width: 33%;"|<br />
::::::::::::<br />
==='''[[Plugins]]'''===<br />
=== ''' &nbsp; ''' ===<br />
|}<br />
<br />
== '''GIDEROS GUIDES AND TUTORIALS''' ==<br />
{|-<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Tutorials ===<br />
[[Lua to Luau conversion guide]]<br/><br />
[[Start Here|You can start here]]<br/><br />
[[Article Tutorials]]<br/><br />
[[Video Tutorials]]<br/><br />
<br />
=== From the Forum ===<br />
[[Examples|Forum Snippets and more...]]<br/><br />
[[ImGui Examples|ImGui Snippets]]<br/><br />
<br />
=== Links ===<br />
[[Made With Gideros]]<br/><br />
[[Developer YouTube Channels|Developers YouTube Channels]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Ultimate Guide ===<br />
[[Introduction]]<br/><br />
[[Gideros Studio]]<br/><br />
[[Getting Started]]<br/><br />
[[Gideros Player]]<br/><br />
[[Your first code]]<br/><br />
[[Introduction to Lua]]<br/><br />
[[Classes in Gideros]]<br/><br />
[[Scene Management]]<br/><br />
[[Introduction to Graphics]]<br/><br />
[[Introduction to Graphics Shapes]]<br/><br />
[[Introduction to Fonts]]<br/><br />
[[Playing Sound and Music]]<br/><br />
[[Event system]]<br/><br />
[[File system]]<br/><br />
[[Profiling]]<br/><br />
[[Hardware and OS]]<br/><br />
[[Exporting to a Player|Exporting your project ('''Xbox, ...''')]]<br/><br />
[[Making a Plugin]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Latest ===<br />
[[Latest Release|Latest Gideros]]<br/><br />
[[Latest Luau]]<br/><br />
|}<br />
<br />
== '''GIDEROS SHORTS''' ==<br />
[[Short-Issue-1|#1 - June 2023 - Overheat]]<br />
<br />
== '''GIDEROS PEBBLES''' ==<br />
[[Lua Shaders Pebbles|Lua Shaders]]</br><br />
[[3D Demos|3D Demos]]</br><br />
<br />
== '''GIDEROS 2D HELPERS''' ==<br />
{|-<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== UI Classes ===<br />
[[UI Buttons|UI Buttons]]<br/><br />
[[UI Color Picker|UI Color Picker]]<br/><br />
[[UI Scrollable List|UI Scrollable List]]<br/><br />
[[UI Slider|UI Sliders]]<br/><br />
[[UI Text|UI Text]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Game Helpers ===<br />
[[Scene Manager|Scene Manager/Easing]]<br/><br />
[[Game Camera]]<br/><br />
[[Animated Sprite Factory|Animations (Sprite Sheets)]]<br/><br />
[[Mobile Controls]]<br/><br />
[[Tiled Map Editor|Tiled]]<br/><br />
[[CBump Template|CBump Template]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Plugins Helpers ===<br />
[[Media Plugin]]<br/><br />
|}<br />
<br />
== '''GIDEROS 3D HELPERS''' ==<br />
{|-<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== ReactPhysics3D ===<br />
[[3D Plane]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
|}<br />
<br />
== '''GIDEROS ADVANCED''' ==<br />
{|-<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Advanced ===<br />
[[Writing Shaders]]<br/><br />
''[[Lua Shaders]]''<br/><br />
[[Compiling Gideros Source]]<br/><br />
[[Compiling Gideros Luau Source|Compiling Gideros Luau '''WIP''']]<br/><br />
[[What Does What]]<br/><br />
[[Helping With Documentation]]<br/><br />
[[CPlusPlus for Gideros Studio Help]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Wiki Special Links ===<br />
[[Special:AllPages]]<br/><br />
[[All Classes and more]]<br/><br />
[[Wiki Sandbox]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
|}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Welcome!&diff=22518Welcome!2023-09-15T09:31:25Z<p>Hgy29: /* GIDEROS PEBBLES */</p>
<hr />
<div>__NOTOC__<br />
== '''GIDEROS API REFERENCES''' ==<br />
{|-<br />
|style="width: 33%;"|<br />
::::::::::::<br />
==='''[[Lua API]]'''===<br />
=== ''' &nbsp; ''' ===<br />
<br />
|style="width: 33%;"|<br />
::::::::::::<br />
==='''[[Main API]]'''===<br />
=== ''' &nbsp; ''' ===<br />
<br />
|style="width: 33%;"|<br />
::::::::::::<br />
==='''[[Plugins]]'''===<br />
=== ''' &nbsp; ''' ===<br />
|}<br />
<br />
== '''GIDEROS GUIDES AND TUTORIALS''' ==<br />
{|-<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Tutorials ===<br />
[[Lua to Luau conversion guide]]<br/><br />
[[Start Here|You can start here]]<br/><br />
[[Article Tutorials]]<br/><br />
[[Video Tutorials]]<br/><br />
<br />
=== From the Forum ===<br />
[[Examples|Forum Snippets and more...]]<br/><br />
[[ImGui Examples|ImGui Snippets]]<br/><br />
<br />
=== Links ===<br />
[[Made With Gideros]]<br/><br />
[[Developer YouTube Channels|Developers YouTube Channels]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Ultimate Guide ===<br />
[[Introduction]]<br/><br />
[[Gideros Studio]]<br/><br />
[[Getting Started]]<br/><br />
[[Gideros Player]]<br/><br />
[[Your first code]]<br/><br />
[[Introduction to Lua]]<br/><br />
[[Classes in Gideros]]<br/><br />
[[Scene Management]]<br/><br />
[[Introduction to Graphics]]<br/><br />
[[Introduction to Graphics Shapes]]<br/><br />
[[Introduction to Fonts]]<br/><br />
[[Playing Sound and Music]]<br/><br />
[[Event system]]<br/><br />
[[File system]]<br/><br />
[[Profiling]]<br/><br />
[[Hardware and OS]]<br/><br />
[[Exporting to a Player|Exporting your project ('''Xbox, ...''')]]<br/><br />
[[Making a Plugin]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Latest ===<br />
[[Latest Release|Latest Gideros]]<br/><br />
[[Latest Luau]]<br/><br />
|}<br />
<br />
== '''GIDEROS SHORTS''' ==<br />
[[Short-Issue-1|#1 - June 2023 - Overheat]]<br />
<br />
== '''GIDEROS PEBBLES''' ==<br />
[[Lua Shaders Pebbles|Lua Shaders]]<br />
[[3D Demos|3D Demos]]<br />
<br />
== '''GIDEROS 2D HELPERS''' ==<br />
{|-<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== UI Classes ===<br />
[[UI Buttons|UI Buttons]]<br/><br />
[[UI Color Picker|UI Color Picker]]<br/><br />
[[UI Scrollable List|UI Scrollable List]]<br/><br />
[[UI Slider|UI Sliders]]<br/><br />
[[UI Text|UI Text]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Game Helpers ===<br />
[[Scene Manager|Scene Manager/Easing]]<br/><br />
[[Game Camera]]<br/><br />
[[Animated Sprite Factory|Animations (Sprite Sheets)]]<br/><br />
[[Mobile Controls]]<br/><br />
[[Tiled Map Editor|Tiled]]<br/><br />
[[CBump Template|CBump Template]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Plugins Helpers ===<br />
[[Media Plugin]]<br/><br />
|}<br />
<br />
== '''GIDEROS 3D HELPERS''' ==<br />
{|-<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== ReactPhysics3D ===<br />
[[3D Plane]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
|}<br />
<br />
== '''GIDEROS ADVANCED''' ==<br />
{|-<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Advanced ===<br />
[[Writing Shaders]]<br/><br />
''[[Lua Shaders]]''<br/><br />
[[Compiling Gideros Source]]<br/><br />
[[Compiling Gideros Luau Source|Compiling Gideros Luau '''WIP''']]<br/><br />
[[What Does What]]<br/><br />
[[Helping With Documentation]]<br/><br />
[[CPlusPlus for Gideros Studio Help]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Wiki Special Links ===<br />
[[Special:AllPages]]<br/><br />
[[All Classes and more]]<br/><br />
[[Wiki Sandbox]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
|}</div>Hgy29https://wiki.gideros.rocks/index.php?title=MovieClip.getTweenFunction&diff=22517MovieClip.getTweenFunction2023-08-31T06:59:51Z<p>Hgy29: </p>
<hr />
<div>__NOTOC__<br />
'''Available since:''' Gideros 2023.9<br/><br />
'''Class:''' [[MovieClip]]<br/><br />
<br />
=== Description ===<br />
Retrieves a native tween/easing function by its name.<br />
<syntaxhighlight lang="lua"><br />
(function) = MovieClip.getTweenFunction(name)<br />
</syntaxhighlight><br />
<br />
=== Parameters ===<br />
'''name''': (string) The name of the requested tween function<br/><br />
<br />
=== Return values ===<br />
'''Returns''' (function) the specified tween function, or linear tween function if name wasn't recognized<br/><br />
<br />
{{MovieClip}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=MovieClip.getTweenFunction&diff=22516MovieClip.getTweenFunction2023-08-31T06:58:47Z<p>Hgy29: Created page with "__NOTOC__ '''Available since:''' Gideros 2023.9<br/> '''Class:''' MovieClip<br/> === Description === Retrieves a native tween/easing function by its name. <syntaxhighligh..."</p>
<hr />
<div>__NOTOC__<br />
'''Available since:''' Gideros 2023.9<br/><br />
'''Class:''' [[MovieClip]]<br/><br />
<br />
=== Description ===<br />
Retrieves a native tween/easing function by its name.<br />
<syntaxhighlight lang="lua"><br />
(function) = MovieClip.getTweenFunction(name)<br />
</syntaxhighlight><br />
<br />
=== Parameters ===<br />
'''name''': (string) The name of the requested tween function<br/><br />
<br />
{{MovieClip}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=MovieClip&diff=22515MovieClip2023-08-31T06:55:46Z<p>Hgy29: /* Methods */</p>
<hr />
<div>__NOTOC__<br />
<!-- GIDEROSOBJ:MovieClip --><br />
'''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/><br />
'''Available since:''' Gideros 2011.6<br/><br />
'''Inherits from:''' [[Sprite]]<br/><br />
<br />
=== Description ===<br />
The MovieClip class inherits from the following classes: [[Sprite]] > [[EventDispatcher]].<br />
<br />
The MovieClip class is used to create static timedlined animations. The timeline parameters are given as an array.<br />
<br />
Each array element specifies one timeline element and consists of: '''the starting frame''' (frame numbers start from 1)''', the ending frame, a sprite and an optional tweening parameters'''.<br />
<br />
When a MovieClip object finishes playing (by reaching its final frame or a frame with stop action), it dispatches an [[Event.COMPLETE]] event.<br />
<br />
The following properties can be tweened:<br />
*''x''<br />
*''y''<br />
*''rotation''<br />
*''scale''<br />
*''scaleX''<br />
*''scaleY''<br />
*''alpha''<br />
*''anchorX''<br />
*''anchorY''<br />
<br />
Additionally MovieClip uses a function to tween properties. If you override the default tween function then you can tween this parameter too. The following easing functions can be used:<br />
* ''"inBack"''<br />
* ''"outBack"''<br />
* ''"inOutBack"''<br />
* ''"inBounce"''<br />
* ''"outBounce"''<br />
* ''"inOutBounce"''<br />
* ''"inCircular"''<br />
* ''"outCircular"''<br />
* ''"inOutCircular"'<br />
* ''"inCubic"''<br />
* ''"outCubic"''<br />
* ''"inOutCubic"''<br />
* ''"inElastic"''<br />
* ''"outElastic"''<br />
* ''"inOutElastic"''<br />
* ''"inExponential"''<br />
* ''"outExponential"''<br />
* ''"inOutExponential"''<br />
* ''"linear"''<br />
* ''"inQuadratic"''<br />
* ''"outQuadratic"''<br />
* ''"inOutQuadratic"''<br />
* ''"inQuartic"''<br />
* ''"outQuartic"''<br />
* ''"inOutQuartic"''<br />
* ''"inQuintic"''<br />
* ''"outQuintic"''<br />
* ''"inOutQuintic"''<br />
* ''"inSine"''<br />
* ''"outSine"''<br />
* ''"inOutSine"''<br />
<br />
=== Examples ===<br />
<syntaxhighlight lang="lua"><br />
-- construct a 100 frame animation where x coordinate of sprite tweens from 0 to 200 linearly<br />
local mc = MovieClip.new{<br />
{1, 100, sprite, {x = {0, 200, "linear"}}}<br />
}<br />
<br />
-- construct a 100 frame animation where x coordinate of sprite is 50 (constant) and <br />
-- y coordinate of sprite tweens from 50 to 150 by using inBounce function<br />
local mc = MovieClip.new{<br />
{1, 100, sprite, {x = 50, y = {50, 150, "inBounce"}}}<br />
}<br />
<br />
-- construct a 200 frame animation where sprite1 and sprite2 tweens differently<br />
-- here sprite1 is visible between frames [1, 150]<br />
-- and sprite2 is visible between frames [100, 200]<br />
local mc = MovieClip.new{<br />
{1, 100, sprite1, {x = {0, 200, "linear"}}},<br />
{50, 150, sprite1, {y = {0, 100, "linear"}, alpha = {0, 1, "easeOut"}}},<br />
{100, 200, sprite2, {x = {0, 200, "linear"}}},<br />
}<br />
<br />
-- construct a looping 6 frame animation where each frame is a different sprite<br />
local mc = MovieClip.new{<br />
{1, 1, frame1}, <br />
{2, 2, frame2}, <br />
{3, 3, frame3}, <br />
{4, 4, frame4}, <br />
{5, 5, frame5}, <br />
{6, 6, frame6},<br />
}<br />
mc:setGotoAction(6, 1) -- if the animation reaches frame 6 then go to frame 1<br />
<br />
-- construct a looping 6 frame animation playing 5 times slower than the previous example<br />
local mc = MovieClip.new{<br />
{1, 5, frame1}, <br />
{5, 10, frame2}, <br />
{11, 15, frame3}, <br />
{16, 20, frame4}, <br />
{21, 25, frame5}, <br />
{26, 30, frame6},<br />
}<br />
mc:setGotoAction(30, 1) -- if the animation reaches frame 30 then go to frame 1<br />
</syntaxhighlight><br />
<br />
{|-<br />
| style="width: 50%; vertical-align:top;"|<br />
=== Methods ===<br />
[[MovieClip.new]] ''creates a new MovieClip object''<br/><!--GIDEROSMTD:MovieClip.new(timeline) creates a new MovieClip object--><br />
[[MovieClip:clearAction]] ''clears the action at the specified frame''<br/><!--GIDEROSMTD:MovieClip:clearAction(frame) clears the action at the specified frame--><br />
[[MovieClip:getFrame]] ''gets the current frame''<br/><!--GIDEROSMTD:MovieClip:getFrame() gets the current frame--><br />
[[MovieClip.getTweenFunction]] ''retrieves the specified tween/easing function''<br/><!--GIDEROSMTD:MovieClip.getTweenFunction(name) retrieves the specified tween/easing function--><br />
[[MovieClip:gotoAndPlay]] ''goes to the specified frame and starts playing''<br/><!--GIDEROSMTD:MovieClip:gotoAndPlay(frame,reverse) goes to the specified frame and starts playing--><br />
[[MovieClip:gotoAndStop]] ''goes to the specified frame and stops''<br/><!--GIDEROSMTD:MovieClip:gotoAndStop(frame) goes to the specified frame and stops--><br />
[[MovieClip:play]] ''starts playing the movie clip''<br/><!--GIDEROSMTD:MovieClip:play(reverse) starts playing the movie clip--><br />
[[MovieClip:isPlaying]] ''returns whether or not current clip is playing''<br/><!--GIDEROSMTD:MovieClip:isPlaying() eturns whether or not current clip is playing--><br />
[[MovieClip:setGotoAction]] ''sets a "go to" action to the specified frame''<br/><!--GIDEROSMTD:MovieClip:setGotoAction(frame,destframe) sets a "go to" action to the specified frame--><br />
[[MovieClip:setReverseAction]] ''sets a "reverse" action to the specified frame''<br/><!--GIDEROSMTD:MovieClip:setReverseAction(frame) sets a "reverse" action to the specified frame--><br />
[[MovieClip:setStopAction]] ''sets a "stop" action to the specified frame''<br/><!--GIDEROSMTD:MovieClip:setStopAction(frame) sets a "stop" action to the specified frame--><br />
[[MovieClip:stop]] ''stops playing the movie clip''<br/><!--GIDEROSMTD:MovieClip:stop() stops playing the movie clip--><br />
<br />
| style="width: 50%; vertical-align:top;"|<br />
<br />
=== Events ===<br />
<!--[[Event.COMPLETE]]<br/>--><br />
[[MovieClip_Event.COMPLETE]]<br/><!-- GIDEROSEVT:Event.COMPLETE movie clip complete event--><br />
=== Constants ===<br />
|}<br />
<br />
{{GIDEROS IMPORTANT LINKS}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Sound.new&diff=22514Sound.new2023-08-31T05:44:14Z<p>Hgy29: /* Parameters */</p>
<hr />
<div>__NOTOC__<br />
'''Available since:''' Gideros 2011.6<br/><br />
'''Class:''' [[Sound]]<br/><br />
<br />
=== Description ===<br />
Creates a new '''Sound''' object.<br />
<syntaxhighlight lang="lua"><br />
Sound.new(filename)<br />
Sound.new(data,rate,stereo)<br />
</syntaxhighlight><br />
<br />
=== Parameters ===<br />
'''filename''': (string) the path of the sound file to be loaded<br/><br />
'''data''': (table) an array of values between -1 and 1 describing the waveform of the sound<br/><br />
'''rate''': (number) the sampling rate of the waveform<br/><br />
'''stereo''': (boolean) set to true if the array contains two channels<br/><br />
<br />
{{Sound}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Sound.new&diff=22513Sound.new2023-08-31T05:41:50Z<p>Hgy29: /* Description */</p>
<hr />
<div>__NOTOC__<br />
'''Available since:''' Gideros 2011.6<br/><br />
'''Class:''' [[Sound]]<br/><br />
<br />
=== Description ===<br />
Creates a new '''Sound''' object.<br />
<syntaxhighlight lang="lua"><br />
Sound.new(filename)<br />
Sound.new(data,rate,stereo)<br />
</syntaxhighlight><br />
<br />
=== Parameters ===<br />
'''filename''': (string) the path of the sound file to be loaded<br/><br />
<br />
{{Sound}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Sound&diff=22512Sound2023-08-31T05:41:10Z<p>Hgy29: /* Methods */</p>
<hr />
<div>__NOTOC__<br />
<!-- GIDEROSOBJ:Sound --><br />
'''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/><br />
'''Available since:''' Gideros 2011.6<br/><br />
'''Inherits from:''' [[Object]]<br/><br />
<br />
=== Description ===<br />
The '''Sound''' class lets you load and play WAV, MP3, MOD, XM, S3M and IT sound files.<br />
<br />
Control of the playing sound is performed through the [[SoundChannel]] object.<br />
<br />
=== Example ===<br />
'''Play a background music in loop'''<br />
<syntaxhighlight lang="lua"><br />
--local sound = Sound.new("bgmusicloop.wav")<br />
local sound = Sound.new("bgmusicloop.mp3")<br />
<br />
print(sound:getLength())<br />
<br />
local channel = sound:play(26000, true, false)<br />
<br />
print(channel:getPosition())<br />
channel:setPosition(20000)<br />
print(channel:getPosition())<br />
channel:setPaused(false)<br />
<br />
channel:addEventListener(Event.COMPLETE, function() print("complete") end)<br />
<br />
local function onTimer()<br />
-- print(channel:getPosition(), sound:getLength())<br />
collectgarbage()<br />
end<br />
<br />
local t = Timer.new(100)<br />
t:addEventListener(Event.TIMER, onTimer)<br />
t:start()<br />
<br />
stage:addEventListener(Event.MOUSE_DOWN, function()<br />
channel:setPaused(not channel:isPaused())<br />
channel:setPosition(10000)<br />
-- channel:setPitch(1.5)<br />
end)<br />
</syntaxhighlight><br />
<br />
=== See also ===<br />
'''[[SoundChannel]]'''<br/><br />
'''[[Playing_Sound_and_Music]]'''<br />
<br />
{|-<br />
| style="width: 50%; vertical-align:top;"|<br />
=== Methods ===<br />
[[Sound.new]] ''creates a new Sound object from a file''<br/><!--GIDEROSMTD:Sound.new(filename) creates a new Sound object from a file--><br />
[[Sound.new]] ''creates a new Sound object from a table''<br/><!--GIDEROSMTD:Sound.new(data,rate,stereo) creates a new Sound object from a table--><br />
[[Sound.setListenerPosition]] ''sets the position, velocity and orientation of the listener''<br/><!--GIDEROSMTD:Sound.setListenerPosition(x,y,z,vx,vy,vz,dx,dy,dz,ux,uy,uz) sets the position, velocity and orientation of the listener--><br />
[[Sound:getLength]] ''gets the sound duration''<br/><!--GIDEROSMTD:Sound:getLength() gets the sound duration--><br />
[[Sound:play]] ''creates a new SoundChannel object to play the sound''<br/><!--GIDEROSMTD:Sound:play(startTime,looping,paused) creates a new SoundChannel object to play the sound--><br />
<br />
| style="width: 50%; vertical-align:top;"|<br />
<br />
=== Events ===<br />
=== Constants ===<br />
|}<br />
<br />
{{GIDEROS IMPORTANT LINKS}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Application:set&diff=22511Application:set2023-08-30T08:49:13Z<p>Hgy29: /* Compatibility table */</p>
<hr />
<div>__NOTOC__<br />
'''Available since:''' Gideros 2015.7<br/><br />
'''Class:''' [[Application]]<br/><br />
<br />
=== Description ===<br />
Sets the state of the desktop setting provided as string parameter.<br />
<syntaxhighlight lang="lua"><br />
application:set(setting, value)<br />
</syntaxhighlight><br />
<br />
<br />
'''new''' Gideros 2022.1: implement '''application:set("wintabMode")'''<br />
<br />
=== Parameters ===<br />
'''setting''': (string) the desktop setting<br/><br />
'''value''': (varies) the new setting value(s)<br/><br />
<br />
=== '''Compatibility table''' ===<br />
{| class="wikitable" style="text-align: center;"<br />
!!!QT!!Win32!!UWP!!Android!!Apple MacOS!!Apple iOS!!Apple tvOS!!Linux!!HTML<br />
|-<br />
|clipboard||X||X||||||||||||X||<br />
|-<br />
|cursor||X||X||X||||X||||||X||X<br />
|-<br />
|cursorPosition||X||X||||||||||||||<br />
|-<br />
|documentDirectory||X||X||||||||||||X||<br />
|-<br />
|maximumSize||X||||||||||||||||<br />
|-<br />
|minimumSize||X||||||||||||||||<br />
|-<br />
|mkDir||X||X||||||||||||X||<br />
|-<br />
|temporaryDirectory||X||X||||||||||||X||<br />
|-<br />
|windowColor||X||||||||||||||||<br />
|-<br />
|windowModel||X||||||||||||||||<br />
|-<br />
|windowPosition||X||X||||||||||||X||<br />
|-<br />
|windowSize||X||X||||||||||||X||<br />
|-<br />
|windowTitle||X||X||||||||||||X||X<br />
|-<br />
|wintabMode||X||||||||||||||||<br />
|}<br />
<br />
=== List of available parameters and settings ===<br />
To get a list of parameters that can be set use:<br />
<syntaxhighlight lang="lua"><br />
print(application:set("help"))<br />
--[[<br />
- windowPosition(x,y)<br />
- windowSize(w,h)<br />
- minimumSize(w,h)<br />
- maximumSize(w,h)<br />
- windowColor(r,g,b)<br />
- windowTitle(text)<br />
- windowModel(type//help)<br />
- cursor(type//help)<br />
- cursorPosition(x,y)<br />
- clipboard(text)<br />
- mkdir(path|dirName//help)<br />
- documentDirectory(path)<br />
- temporaryDirectory(path)<br />
]]<br />
</syntaxhighlight><br />
<br />
To get help for individual settings use:<br />
<syntaxhighlight lang="lua"><br />
print(application:set("cursor","help")) -- eg: cursor<br />
--[[<br />
Accepted value for cursor :<br />
- arrow<br />
- upArrow<br />
- cross<br />
- wait<br />
- IBeam<br />
- sizeVer<br />
- sizeHor<br />
- sizeBDiag<br />
- sizeFDiag<br />
- sizeAll<br />
- blank -- not available on win32<br />
- splitV<br />
- splitH<br />
- pointingHand<br />
- forbidden<br />
- whatsThis<br />
- busy<br />
- openHand -- not available on win32<br />
- closedHand -- not available on win32<br />
- dragCopy -- not available on win32<br />
- dragMove -- not available on win32<br />
- dragLink -- not available on win32<br />
]]<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="lua"><br />
print(application:set("windowModel","help")) -- eg: window mode<br />
--[[<br />
Accepted value for windowModel :<br />
- reset<br />
- stayOnTop<br />
- stayOnBottom<br />
- frameless<br />
- noTitleBar<br />
- noButton<br />
- onlyMinimize<br />
- onlyMaximize<br />
- onlyClose<br />
- noMinimize<br />
- noMaximize<br />
- noClose<br />
- helpButton<br />
]]<br />
</syntaxhighlight><br />
<br />
=== Examples ===<br />
<syntaxhighlight lang="lua"><br />
application:set("windowPosition", 64, 64)<br />
application:set("windowColor", 0, 0, 0)<br />
application:set("windowTitle", "My lovely window title")<br />
application:set("cursor", "openHand")<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="lua"><br />
-- global app size<br />
myappleft, myapptop, myappright, myappbot = application:getLogicalBounds()<br />
myappwidth, myappheight = myappright - myappleft, myappbot - myapptop<br />
<br />
if application:getDeviceInfo() == "Windows" and not application:isPlayerMode() then<br />
application:set("windowPosition", myappwidth * 1.2, 16)<br />
application:set("windowModel", "onlyClose")<br />
-- application:set("windowModel", "noMaximize") -- doesn't work for me!<br />
application:set("windowTitle", "App Title")<br />
application:set("minimumSize", myappwidth, myappheight)<br />
application:set("maximumSize", myappwidth, myappheight)<br />
application:set("windowColor", 0, 0, 0)<br />
end<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="lua"><br />
application:set("mkDir", application:get("directory","executable").."|dirName")<br />
</syntaxhighlight><br />
<br />
{{Application}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Application:set&diff=22510Application:set2023-08-30T08:47:25Z<p>Hgy29: </p>
<hr />
<div>__NOTOC__<br />
'''Available since:''' Gideros 2015.7<br/><br />
'''Class:''' [[Application]]<br/><br />
<br />
=== Description ===<br />
Sets the state of the desktop setting provided as string parameter.<br />
<syntaxhighlight lang="lua"><br />
application:set(setting, value)<br />
</syntaxhighlight><br />
<br />
<br />
'''new''' Gideros 2022.1: implement '''application:set("wintabMode")'''<br />
<br />
=== Parameters ===<br />
'''setting''': (string) the desktop setting<br/><br />
'''value''': (varies) the new setting value(s)<br/><br />
<br />
=== '''Compatibility table''' ===<br />
{| class="wikitable" style="text-align: center;"<br />
!!!QT!!Win32!!UWP!!Android!!Apple MacOS!!Apple iOS!!Apple tvOS!!Linux!!HTML<br />
|-<br />
|clipboard||X||X||||||||||||X||<br />
|-<br />
|cursor||X||X||||||||||||X||X<br />
|-<br />
|cursorPosition||X||X||||||||||||||<br />
|-<br />
|documentDirectory||X||X||||||||||||X||<br />
|-<br />
|maximumSize||X||||||||||||||||<br />
|-<br />
|minimumSize||X||||||||||||||||<br />
|-<br />
|mkDir||X||X||||||||||||X||<br />
|-<br />
|temporaryDirectory||X||X||||||||||||X||<br />
|-<br />
|windowColor||X||||||||||||||||<br />
|-<br />
|windowModel||X||||||||||||||||<br />
|-<br />
|windowPosition||X||X||||||||||||X||<br />
|-<br />
|windowSize||X||X||||||||||||X||<br />
|-<br />
|windowTitle||X||X||||||||||||X||X<br />
|-<br />
|wintabMode||X||||||||||||||||<br />
|}<br />
<br />
=== List of available parameters and settings ===<br />
To get a list of parameters that can be set use:<br />
<syntaxhighlight lang="lua"><br />
print(application:set("help"))<br />
--[[<br />
- windowPosition(x,y)<br />
- windowSize(w,h)<br />
- minimumSize(w,h)<br />
- maximumSize(w,h)<br />
- windowColor(r,g,b)<br />
- windowTitle(text)<br />
- windowModel(type//help)<br />
- cursor(type//help)<br />
- cursorPosition(x,y)<br />
- clipboard(text)<br />
- mkdir(path|dirName//help)<br />
- documentDirectory(path)<br />
- temporaryDirectory(path)<br />
]]<br />
</syntaxhighlight><br />
<br />
To get help for individual settings use:<br />
<syntaxhighlight lang="lua"><br />
print(application:set("cursor","help")) -- eg: cursor<br />
--[[<br />
Accepted value for cursor :<br />
- arrow<br />
- upArrow<br />
- cross<br />
- wait<br />
- IBeam<br />
- sizeVer<br />
- sizeHor<br />
- sizeBDiag<br />
- sizeFDiag<br />
- sizeAll<br />
- blank -- not available on win32<br />
- splitV<br />
- splitH<br />
- pointingHand<br />
- forbidden<br />
- whatsThis<br />
- busy<br />
- openHand -- not available on win32<br />
- closedHand -- not available on win32<br />
- dragCopy -- not available on win32<br />
- dragMove -- not available on win32<br />
- dragLink -- not available on win32<br />
]]<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="lua"><br />
print(application:set("windowModel","help")) -- eg: window mode<br />
--[[<br />
Accepted value for windowModel :<br />
- reset<br />
- stayOnTop<br />
- stayOnBottom<br />
- frameless<br />
- noTitleBar<br />
- noButton<br />
- onlyMinimize<br />
- onlyMaximize<br />
- onlyClose<br />
- noMinimize<br />
- noMaximize<br />
- noClose<br />
- helpButton<br />
]]<br />
</syntaxhighlight><br />
<br />
=== Examples ===<br />
<syntaxhighlight lang="lua"><br />
application:set("windowPosition", 64, 64)<br />
application:set("windowColor", 0, 0, 0)<br />
application:set("windowTitle", "My lovely window title")<br />
application:set("cursor", "openHand")<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="lua"><br />
-- global app size<br />
myappleft, myapptop, myappright, myappbot = application:getLogicalBounds()<br />
myappwidth, myappheight = myappright - myappleft, myappbot - myapptop<br />
<br />
if application:getDeviceInfo() == "Windows" and not application:isPlayerMode() then<br />
application:set("windowPosition", myappwidth * 1.2, 16)<br />
application:set("windowModel", "onlyClose")<br />
-- application:set("windowModel", "noMaximize") -- doesn't work for me!<br />
application:set("windowTitle", "App Title")<br />
application:set("minimumSize", myappwidth, myappheight)<br />
application:set("maximumSize", myappwidth, myappheight)<br />
application:set("windowColor", 0, 0, 0)<br />
end<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="lua"><br />
application:set("mkDir", application:get("directory","executable").."|dirName")<br />
</syntaxhighlight><br />
<br />
{{Application}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Application:get&diff=22509Application:get2023-08-30T08:38:47Z<p>Hgy29: /* Compatibility table */</p>
<hr />
<div>__NOTOC__<br />
'''Available since:''' Gideros 2015.7<br/><br />
'''Class:''' [[Application]]<br/><br />
<br />
=== Description ===<br />
Returns the state of the desktop setting provided as string parameter.<br />
<syntaxhighlight lang="lua"><br />
varies = application:get(setting)<br />
</syntaxhighlight><br />
<br />
=== Parameters ===<br />
'''setting''' (string) the name of the desktop setting<br />
<br />
=== Return values ===<br />
'''Returns''' (varies) the value(s) of the setting<br />
<br />
=== '''Compatibility table''' ===<br />
{| class="wikitable" style="text-align: center;"<br />
!!!QT!!Win32!!UWP!!Android!!Apple MacOS!!Apple iOS!!Apple tvOS!!Linux!!HTML<br />
|-<br />
|batteryLevel||||||||X||||X||||||<br />
|-<br />
|clipboard||X||X||||||||||||X||<br />
|-<br />
|commandLine||||X||||||||||||X||<br />
|-<br />
|currentUrl||||||||||||||||||X<br />
|-<br />
|cursorPosition||X||X||||||||||||X||<br />
|-<br />
|directory||X||X||||||||||||X||<br />
|-<br />
|documentDirectory||X||X||||||||||||X||<br />
|-<br />
|openDirectoryDialog||X||X||X||||X||||||||<br />
|-<br />
|openFileDialog||X||X||X||||X||||||||<br />
|-<br />
|pathfileexists||?||X||||||||||||X||<br />
|-<br />
|saveFileDialog||X||X||X||||X||||||||<br />
|-<br />
|screenSize||X||X||X||||||||||X||X<br />
|-<br />
|temporaryDirectory||X||X||||||||||||X||<br />
|-<br />
|windowPosition||X||X||||||||||||X||<br />
|-<br />
|windowSize||X||X||||||||||||X||<br />
|-<br />
|windowTitle||X||X||||||||||||||X<br />
|}<br />
<br />
=== Examples ===<br />
'''Prints a list of all available settings'''<br />
<syntaxhighlight lang="lua"><br />
print(application:get("help"))<br />
--[[<br />
Accepted value for Desktop's application:get()<br />
- [x,y] windowPosition<br />
- [w,h] windowSize<br />
- [w,h] screenSize<br />
- [x,y] cursorPosition<br />
- [text] clipboard<br />
- [text] windowTitle<br />
- [path] directory(where//help)<br />
- [path] openDirectoryDialog(title|path//help)<br />
- [path] openFileDialog(title|path|extensions//help)<br />
- [path] saveFileDialog(title|path|extensions//help)<br />
- [path] documentDirectory<br />
- [path] temporaryDirectory<br />
0<br />
]]<br />
print("\n")<br />
<br />
print(application:get("directory", "help"))<br />
--[[<br />
Accepted value for directory :<br />
- executable<br />
- document<br />
- desktop<br />
- temporary<br />
- data<br />
- music<br />
- movies<br />
- pictures<br />
- cache<br />
- download<br />
- home<br />
0<br />
]]<br />
</syntaxhighlight><br />
<br />
'''Various examples'''<br />
<syntaxhighlight lang="lua"><br />
print(application:get("windowTitle"))<br />
print(application:get("documentDirectory"))<br />
print(application:get("temporaryDirectory"))<br />
<br />
-- get screen size<br />
screenwidth, screenheight = application:get("screenSize") -- the actual user screen size!<br />
application:set("windowPosition", (screenwidth - myappwidth)/2, (screenheight - myappheight)/2) -- center the app<br />
application:set("windowTitle", "MY TITLE")<br />
<br />
-- get the user download folder path<br />
print(application:get("directory", "download")) -- prints C:/Users/xxx/Downloads<br />
</syntaxhighlight><br />
<br />
'''File dialog open directory'''<br />
<syntaxhighlight lang="lua"><br />
--local path = application:get("openDirectoryDialog", "Title|C:/tmp/") -- "title|path" DEPRECATED IN 2022.10<br />
local path = application:get("openDirectoryDialog", "Title", "C:/tmp/") -- "title", "path" NEW WAY<br />
-- win32<br />
local path = application:get("openDirectoryDialog", "Title", "C:\\tmp\\") -- "title", "path" win32 NEW WAY<br />
print(path)<br />
</syntaxhighlight><br />
<br />
'''File dialog open file'''<br />
<syntaxhighlight lang="lua"><br />
print(application:get("openFileDialog","Choisissez un liquide","I:\\","Bidon (*.bdn *.bid);;Fût et Tonneau (*.fut)"))<br />
path = application:get("openFileDialog", "My Title", "c:\\", "Images (*.png *.jpg *.jpeg);;3D (*.obj *.glb *.fbx)"))<br />
print(path) -- on cancel, returns nil for win32 and "" for other systems<br />
<br />
-- file dialog to open a file of type .txt or .png<br />
local path = application:get(<br />
-- "openFileDialog", "Title|C:/tmp/|Text (*.txt);; Image (*.png)") -- "title|path|extensions" DEPRECATED IN 2022.10<br />
"openFileDialog", "Title", "C:/tmp/", "Text (*.txt);; Image (*.png)") -- "title", "path", "extensions" NEW WAY<br />
print(path)<br />
<br />
-- file dialogs on win32 should use a delay Timer.delayedCall or Core.asyncCall<br />
--self.tiled_ui.btnBrowse:addEventListener("clicked", self.browse, self) -- instead of this<br />
self.tiled_ui.btnBrowse:addEventListener("clicked", function()<br />
Core.asyncCall(TheStage.browse, self) -- this<br />
end)<br />
</syntaxhighlight><br />
<br />
'''File dialog save file'''<br />
<syntaxhighlight lang="lua"><br />
-- first we choose the destination<br />
local path = application:get(<br />
-- "saveFileDialog", "Title|C:/tmp/|Text (*.txt);; Image (*.jpg)") -- "title|path|extensions" DEPRECATED IN 2022.10<br />
"saveFileDialog", "Title", "C:/tmp/", "Text (*.txt);; Image (*.jpg)") -- "title", "path", "extensions" NEW WAY<br />
-- and we save some data to it<br />
if path ~= 0 then<br />
--if path ~= nil then -- for win32<br />
local srcf = io.open("mytext.txt", "rb")<br />
local dstf = io.open(path, "wb")<br />
local size = 2^13 -- good buffer size (8K)<br />
while true do local block = srcf:read(size) if not block then break end dstf:write(block) end<br />
srcf:close()<br />
dstf:close()<br />
end<br />
</syntaxhighlight><br />
<br />
'''Path File Exists'''<br />
<syntaxhighlight lang="lua"><br />
-- Path File Exists for Windows 64<br />
-- tests folder path (nil=doesn't exist, 1=exists)<br />
if application:get("pathfileexists", application:get("directory", "pictures").."/Folder01") == nil then<br />
application:set("mkDir", application:get("directory", "pictures"), "Folder01")<br />
application:set("mkDir", application:get("directory", "pictures").."/Folder01", "subfolder01")<br />
application:set("mkDir", application:get("directory", "pictures").."/Folder01", "subfolder02")<br />
end<br />
<br />
-- Path File Exists for win32<br />
-- tests folder path (nil=doesn't exist, 1=exists)<br />
if application:get("pathfileexists", application:get("directory", "pictures").."\\Folder01") == nil then<br />
-- creates it<br />
application:set("mkDir", application:get("directory", "pictures").."\\Folder01")<br />
end<br />
</syntaxhighlight><br />
<br />
{{Application}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Application:get&diff=22508Application:get2023-08-30T08:32:31Z<p>Hgy29: /* Compatibility table */</p>
<hr />
<div>__NOTOC__<br />
'''Available since:''' Gideros 2015.7<br/><br />
'''Class:''' [[Application]]<br/><br />
<br />
=== Description ===<br />
Returns the state of the desktop setting provided as string parameter.<br />
<syntaxhighlight lang="lua"><br />
varies = application:get(setting)<br />
</syntaxhighlight><br />
<br />
=== Parameters ===<br />
'''setting''' (string) the name of the desktop setting<br />
<br />
=== Return values ===<br />
'''Returns''' (varies) the value(s) of the setting<br />
<br />
=== '''Compatibility table''' ===<br />
{| class="wikitable" style="text-align: center;"<br />
!!!QT!!Win32!!UWP!!Android!!Apple MacOS!!Apple iOS!!Apple tvOS!!Linux!!HTML<br />
|-<br />
|batteryLevel||||||||X||||X||||||<br />
|-<br />
|cursorPosition||X||X||||||||||||X||<br />
|-<br />
|clipboard||X||X||||||||||||X||<br />
|-<br />
|currentUrl||||||||||||||||||X<br />
|-<br />
|directory||X||X||||||||||||X||<br />
|-<br />
|documentDirectory||X||X||||||||||||X||<br />
|-<br />
|mkDir||||X||||||||||||X||<br />
|-<br />
|openDirectoryDialog||X||X||X||||X||||||||<br />
|-<br />
|openFileDialog||X||X||X||||X||||||||<br />
|-<br />
|pathfileexists||?||X||||||||||||X||<br />
|-<br />
|saveFileDialog||X||X||X||||X||||||||<br />
|-<br />
|screenSize||X||X||X||||||||||X||X<br />
|-<br />
|temporaryDirectory||X||X||||||||||||X||<br />
|-<br />
|windowPosition||X||X||||||||||||X||<br />
|-<br />
|windowSize||X||X||||||||||||X||<br />
|-<br />
|windowTitle||X||X||||||||||||||X<br />
|-<br />
|||||||||||||||||||<br />
|}<br />
<br />
=== Examples ===<br />
'''Prints a list of all available settings'''<br />
<syntaxhighlight lang="lua"><br />
print(application:get("help"))<br />
--[[<br />
Accepted value for Desktop's application:get()<br />
- [x,y] windowPosition<br />
- [w,h] windowSize<br />
- [w,h] screenSize<br />
- [x,y] cursorPosition<br />
- [text] clipboard<br />
- [text] windowTitle<br />
- [path] directory(where//help)<br />
- [path] openDirectoryDialog(title|path//help)<br />
- [path] openFileDialog(title|path|extensions//help)<br />
- [path] saveFileDialog(title|path|extensions//help)<br />
- [path] documentDirectory<br />
- [path] temporaryDirectory<br />
0<br />
]]<br />
print("\n")<br />
<br />
print(application:get("directory", "help"))<br />
--[[<br />
Accepted value for directory :<br />
- executable<br />
- document<br />
- desktop<br />
- temporary<br />
- data<br />
- music<br />
- movies<br />
- pictures<br />
- cache<br />
- download<br />
- home<br />
0<br />
]]<br />
</syntaxhighlight><br />
<br />
'''Various examples'''<br />
<syntaxhighlight lang="lua"><br />
print(application:get("windowTitle"))<br />
print(application:get("documentDirectory"))<br />
print(application:get("temporaryDirectory"))<br />
<br />
-- get screen size<br />
screenwidth, screenheight = application:get("screenSize") -- the actual user screen size!<br />
application:set("windowPosition", (screenwidth - myappwidth)/2, (screenheight - myappheight)/2) -- center the app<br />
application:set("windowTitle", "MY TITLE")<br />
<br />
-- get the user download folder path<br />
print(application:get("directory", "download")) -- prints C:/Users/xxx/Downloads<br />
</syntaxhighlight><br />
<br />
'''File dialog open directory'''<br />
<syntaxhighlight lang="lua"><br />
--local path = application:get("openDirectoryDialog", "Title|C:/tmp/") -- "title|path" DEPRECATED IN 2022.10<br />
local path = application:get("openDirectoryDialog", "Title", "C:/tmp/") -- "title", "path" NEW WAY<br />
-- win32<br />
local path = application:get("openDirectoryDialog", "Title", "C:\\tmp\\") -- "title", "path" win32 NEW WAY<br />
print(path)<br />
</syntaxhighlight><br />
<br />
'''File dialog open file'''<br />
<syntaxhighlight lang="lua"><br />
print(application:get("openFileDialog","Choisissez un liquide","I:\\","Bidon (*.bdn *.bid);;Fût et Tonneau (*.fut)"))<br />
path = application:get("openFileDialog", "My Title", "c:\\", "Images (*.png *.jpg *.jpeg);;3D (*.obj *.glb *.fbx)"))<br />
print(path) -- on cancel, returns nil for win32 and "" for other systems<br />
<br />
-- file dialog to open a file of type .txt or .png<br />
local path = application:get(<br />
-- "openFileDialog", "Title|C:/tmp/|Text (*.txt);; Image (*.png)") -- "title|path|extensions" DEPRECATED IN 2022.10<br />
"openFileDialog", "Title", "C:/tmp/", "Text (*.txt);; Image (*.png)") -- "title", "path", "extensions" NEW WAY<br />
print(path)<br />
<br />
-- file dialogs on win32 should use a delay Timer.delayedCall or Core.asyncCall<br />
--self.tiled_ui.btnBrowse:addEventListener("clicked", self.browse, self) -- instead of this<br />
self.tiled_ui.btnBrowse:addEventListener("clicked", function()<br />
Core.asyncCall(TheStage.browse, self) -- this<br />
end)<br />
</syntaxhighlight><br />
<br />
'''File dialog save file'''<br />
<syntaxhighlight lang="lua"><br />
-- first we choose the destination<br />
local path = application:get(<br />
-- "saveFileDialog", "Title|C:/tmp/|Text (*.txt);; Image (*.jpg)") -- "title|path|extensions" DEPRECATED IN 2022.10<br />
"saveFileDialog", "Title", "C:/tmp/", "Text (*.txt);; Image (*.jpg)") -- "title", "path", "extensions" NEW WAY<br />
-- and we save some data to it<br />
if path ~= 0 then<br />
--if path ~= nil then -- for win32<br />
local srcf = io.open("mytext.txt", "rb")<br />
local dstf = io.open(path, "wb")<br />
local size = 2^13 -- good buffer size (8K)<br />
while true do local block = srcf:read(size) if not block then break end dstf:write(block) end<br />
srcf:close()<br />
dstf:close()<br />
end<br />
</syntaxhighlight><br />
<br />
'''Path File Exists'''<br />
<syntaxhighlight lang="lua"><br />
-- Path File Exists for Windows 64<br />
-- tests folder path (nil=doesn't exist, 1=exists)<br />
if application:get("pathfileexists", application:get("directory", "pictures").."/Folder01") == nil then<br />
application:set("mkDir", application:get("directory", "pictures"), "Folder01")<br />
application:set("mkDir", application:get("directory", "pictures").."/Folder01", "subfolder01")<br />
application:set("mkDir", application:get("directory", "pictures").."/Folder01", "subfolder02")<br />
end<br />
<br />
-- Path File Exists for win32<br />
-- tests folder path (nil=doesn't exist, 1=exists)<br />
if application:get("pathfileexists", application:get("directory", "pictures").."\\Folder01") == nil then<br />
-- creates it<br />
application:set("mkDir", application:get("directory", "pictures").."\\Folder01")<br />
end<br />
</syntaxhighlight><br />
<br />
{{Application}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Application:get&diff=22507Application:get2023-08-30T08:29:15Z<p>Hgy29: </p>
<hr />
<div>__NOTOC__<br />
'''Available since:''' Gideros 2015.7<br/><br />
'''Class:''' [[Application]]<br/><br />
<br />
=== Description ===<br />
Returns the state of the desktop setting provided as string parameter.<br />
<syntaxhighlight lang="lua"><br />
varies = application:get(setting)<br />
</syntaxhighlight><br />
<br />
=== Parameters ===<br />
'''setting''' (string) the name of the desktop setting<br />
<br />
=== Return values ===<br />
'''Returns''' (varies) the value(s) of the setting<br />
<br />
=== '''Compatibility table''' ===<br />
{| class="wikitable" style="text-align: center;"<br />
!!!QT!!Win32!!UWP!!Android!!Apple MacOS!!Apple iOS!!Apple tvOS!!Linux!!HTML<br />
|-<br />
|batteryLevel||||||||X||||X||||||<br />
|-<br />
|cursorPosition||X||X||||||||||||X||<br />
|-<br />
|clipboard||X||X||||||||||||X||<br />
|-<br />
|currentUrl||||||||||||||||||X<br />
|-<br />
|directory||X||X||||||||||||X||<br />
|-<br />
|documentDirectory||X||X||||||||||||X||<br />
|-<br />
|mkDir||||X||||||||||||X||<br />
|-<br />
|openDirectoryDialog||X||X||X||||X||||||||<br />
|-<br />
|openFileDialog||X||X||X||||X||||||||<br />
|-<br />
|pathfileexists||||X||||||||||||X||<br />
|-<br />
|saveFileDialog||X||X||X||||X||||||||<br />
|-<br />
|screenSize||X||X||X||||||||||X||X<br />
|-<br />
|temporaryDirectory||X||X||||||||||||X||<br />
|-<br />
|windowPosition||X||X||X||||||||||X||<br />
|-<br />
|windowSize||X||X||X||||||||||X||<br />
|-<br />
|windowTitle||X||X||||||||||||||X<br />
|-<br />
|||||||||||||||||||<br />
|}<br />
<br />
=== Examples ===<br />
'''Prints a list of all available settings'''<br />
<syntaxhighlight lang="lua"><br />
print(application:get("help"))<br />
--[[<br />
Accepted value for Desktop's application:get()<br />
- [x,y] windowPosition<br />
- [w,h] windowSize<br />
- [w,h] screenSize<br />
- [x,y] cursorPosition<br />
- [text] clipboard<br />
- [text] windowTitle<br />
- [path] directory(where//help)<br />
- [path] openDirectoryDialog(title|path//help)<br />
- [path] openFileDialog(title|path|extensions//help)<br />
- [path] saveFileDialog(title|path|extensions//help)<br />
- [path] documentDirectory<br />
- [path] temporaryDirectory<br />
0<br />
]]<br />
print("\n")<br />
<br />
print(application:get("directory", "help"))<br />
--[[<br />
Accepted value for directory :<br />
- executable<br />
- document<br />
- desktop<br />
- temporary<br />
- data<br />
- music<br />
- movies<br />
- pictures<br />
- cache<br />
- download<br />
- home<br />
0<br />
]]<br />
</syntaxhighlight><br />
<br />
'''Various examples'''<br />
<syntaxhighlight lang="lua"><br />
print(application:get("windowTitle"))<br />
print(application:get("documentDirectory"))<br />
print(application:get("temporaryDirectory"))<br />
<br />
-- get screen size<br />
screenwidth, screenheight = application:get("screenSize") -- the actual user screen size!<br />
application:set("windowPosition", (screenwidth - myappwidth)/2, (screenheight - myappheight)/2) -- center the app<br />
application:set("windowTitle", "MY TITLE")<br />
<br />
-- get the user download folder path<br />
print(application:get("directory", "download")) -- prints C:/Users/xxx/Downloads<br />
</syntaxhighlight><br />
<br />
'''File dialog open directory'''<br />
<syntaxhighlight lang="lua"><br />
--local path = application:get("openDirectoryDialog", "Title|C:/tmp/") -- "title|path" DEPRECATED IN 2022.10<br />
local path = application:get("openDirectoryDialog", "Title", "C:/tmp/") -- "title", "path" NEW WAY<br />
-- win32<br />
local path = application:get("openDirectoryDialog", "Title", "C:\\tmp\\") -- "title", "path" win32 NEW WAY<br />
print(path)<br />
</syntaxhighlight><br />
<br />
'''File dialog open file'''<br />
<syntaxhighlight lang="lua"><br />
print(application:get("openFileDialog","Choisissez un liquide","I:\\","Bidon (*.bdn *.bid);;Fût et Tonneau (*.fut)"))<br />
path = application:get("openFileDialog", "My Title", "c:\\", "Images (*.png *.jpg *.jpeg);;3D (*.obj *.glb *.fbx)"))<br />
print(path) -- on cancel, returns nil for win32 and "" for other systems<br />
<br />
-- file dialog to open a file of type .txt or .png<br />
local path = application:get(<br />
-- "openFileDialog", "Title|C:/tmp/|Text (*.txt);; Image (*.png)") -- "title|path|extensions" DEPRECATED IN 2022.10<br />
"openFileDialog", "Title", "C:/tmp/", "Text (*.txt);; Image (*.png)") -- "title", "path", "extensions" NEW WAY<br />
print(path)<br />
<br />
-- file dialogs on win32 should use a delay Timer.delayedCall or Core.asyncCall<br />
--self.tiled_ui.btnBrowse:addEventListener("clicked", self.browse, self) -- instead of this<br />
self.tiled_ui.btnBrowse:addEventListener("clicked", function()<br />
Core.asyncCall(TheStage.browse, self) -- this<br />
end)<br />
</syntaxhighlight><br />
<br />
'''File dialog save file'''<br />
<syntaxhighlight lang="lua"><br />
-- first we choose the destination<br />
local path = application:get(<br />
-- "saveFileDialog", "Title|C:/tmp/|Text (*.txt);; Image (*.jpg)") -- "title|path|extensions" DEPRECATED IN 2022.10<br />
"saveFileDialog", "Title", "C:/tmp/", "Text (*.txt);; Image (*.jpg)") -- "title", "path", "extensions" NEW WAY<br />
-- and we save some data to it<br />
if path ~= 0 then<br />
--if path ~= nil then -- for win32<br />
local srcf = io.open("mytext.txt", "rb")<br />
local dstf = io.open(path, "wb")<br />
local size = 2^13 -- good buffer size (8K)<br />
while true do local block = srcf:read(size) if not block then break end dstf:write(block) end<br />
srcf:close()<br />
dstf:close()<br />
end<br />
</syntaxhighlight><br />
<br />
'''Path File Exists'''<br />
<syntaxhighlight lang="lua"><br />
-- Path File Exists for Windows 64<br />
-- tests folder path (nil=doesn't exist, 1=exists)<br />
if application:get("pathfileexists", application:get("directory", "pictures").."/Folder01") == nil then<br />
application:set("mkDir", application:get("directory", "pictures"), "Folder01")<br />
application:set("mkDir", application:get("directory", "pictures").."/Folder01", "subfolder01")<br />
application:set("mkDir", application:get("directory", "pictures").."/Folder01", "subfolder02")<br />
end<br />
<br />
-- Path File Exists for win32<br />
-- tests folder path (nil=doesn't exist, 1=exists)<br />
if application:get("pathfileexists", application:get("directory", "pictures").."\\Folder01") == nil then<br />
-- creates it<br />
application:set("mkDir", application:get("directory", "pictures").."\\Folder01")<br />
end<br />
</syntaxhighlight><br />
<br />
{{Application}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Application:get&diff=22506Application:get2023-08-30T08:12:28Z<p>Hgy29: </p>
<hr />
<div>__NOTOC__<br />
'''Available since:''' Gideros 2015.7<br/><br />
'''Class:''' [[Application]]<br/><br />
<br />
=== Description ===<br />
Returns the state of the desktop setting provided as string parameter.<br />
<syntaxhighlight lang="lua"><br />
varies = application:get(setting)<br />
</syntaxhighlight><br />
<br />
=== Parameters ===<br />
'''setting''' (string) the name of the desktop setting<br />
<br />
=== Return values ===<br />
'''Returns''' (varies) the value(s) of the setting<br />
<br />
=== '''Compatibility table''' ===<br />
{| class="wikitable" style="text-align: center;"<br />
!!!QT!!Win32!!UWP!!Android!!Apple MacOS!!Apple iOS!!Apple tvOS!!Linux!!HTML<br />
|-<br />
|batteryLevel||||||||X||||X||||||<br />
|-<br />
|windowPosition||X||X||X||||X||||||X||<br />
|-<br />
|||||||||||||||||||<br />
|}<br />
<br />
=== Examples ===<br />
'''Prints a list of all available settings'''<br />
<syntaxhighlight lang="lua"><br />
print(application:get("help"))<br />
--[[<br />
Accepted value for Desktop's application:get()<br />
- [x,y] windowPosition<br />
- [w,h] windowSize<br />
- [w,h] screenSize<br />
- [x,y] cursorPosition<br />
- [text] clipboard<br />
- [text] windowTitle<br />
- [path] directory(where//help)<br />
- [path] openDirectoryDialog(title|path//help)<br />
- [path] openFileDialog(title|path|extensions//help)<br />
- [path] saveFileDialog(title|path|extensions//help)<br />
- [path] documentDirectory<br />
- [path] temporaryDirectory<br />
0<br />
]]<br />
print("\n")<br />
<br />
print(application:get("directory", "help"))<br />
--[[<br />
Accepted value for directory :<br />
- executable<br />
- document<br />
- desktop<br />
- temporary<br />
- data<br />
- music<br />
- movies<br />
- pictures<br />
- cache<br />
- download<br />
- home<br />
0<br />
]]<br />
</syntaxhighlight><br />
<br />
'''Various examples'''<br />
<syntaxhighlight lang="lua"><br />
print(application:get("windowTitle"))<br />
print(application:get("documentDirectory"))<br />
print(application:get("temporaryDirectory"))<br />
<br />
-- get screen size<br />
screenwidth, screenheight = application:get("screenSize") -- the actual user screen size!<br />
application:set("windowPosition", (screenwidth - myappwidth)/2, (screenheight - myappheight)/2) -- center the app<br />
application:set("windowTitle", "MY TITLE")<br />
<br />
-- get the user download folder path<br />
print(application:get("directory", "download")) -- prints C:/Users/xxx/Downloads<br />
</syntaxhighlight><br />
<br />
'''File dialog open directory'''<br />
<syntaxhighlight lang="lua"><br />
--local path = application:get("openDirectoryDialog", "Title|C:/tmp/") -- "title|path" DEPRECATED IN 2022.10<br />
local path = application:get("openDirectoryDialog", "Title", "C:/tmp/") -- "title", "path" NEW WAY<br />
-- win32<br />
local path = application:get("openDirectoryDialog", "Title", "C:\\tmp\\") -- "title", "path" win32 NEW WAY<br />
print(path)<br />
</syntaxhighlight><br />
<br />
'''File dialog open file'''<br />
<syntaxhighlight lang="lua"><br />
print(application:get("openFileDialog","Choisissez un liquide","I:\\","Bidon (*.bdn *.bid);;Fût et Tonneau (*.fut)"))<br />
path = application:get("openFileDialog", "My Title", "c:\\", "Images (*.png *.jpg *.jpeg);;3D (*.obj *.glb *.fbx)"))<br />
print(path) -- on cancel, returns nil for win32 and "" for other systems<br />
<br />
-- file dialog to open a file of type .txt or .png<br />
local path = application:get(<br />
-- "openFileDialog", "Title|C:/tmp/|Text (*.txt);; Image (*.png)") -- "title|path|extensions" DEPRECATED IN 2022.10<br />
"openFileDialog", "Title", "C:/tmp/", "Text (*.txt);; Image (*.png)") -- "title", "path", "extensions" NEW WAY<br />
print(path)<br />
<br />
-- file dialogs on win32 should use a delay Timer.delayedCall or Core.asyncCall<br />
--self.tiled_ui.btnBrowse:addEventListener("clicked", self.browse, self) -- instead of this<br />
self.tiled_ui.btnBrowse:addEventListener("clicked", function()<br />
Core.asyncCall(TheStage.browse, self) -- this<br />
end)<br />
</syntaxhighlight><br />
<br />
'''File dialog save file'''<br />
<syntaxhighlight lang="lua"><br />
-- first we choose the destination<br />
local path = application:get(<br />
-- "saveFileDialog", "Title|C:/tmp/|Text (*.txt);; Image (*.jpg)") -- "title|path|extensions" DEPRECATED IN 2022.10<br />
"saveFileDialog", "Title", "C:/tmp/", "Text (*.txt);; Image (*.jpg)") -- "title", "path", "extensions" NEW WAY<br />
-- and we save some data to it<br />
if path ~= 0 then<br />
--if path ~= nil then -- for win32<br />
local srcf = io.open("mytext.txt", "rb")<br />
local dstf = io.open(path, "wb")<br />
local size = 2^13 -- good buffer size (8K)<br />
while true do local block = srcf:read(size) if not block then break end dstf:write(block) end<br />
srcf:close()<br />
dstf:close()<br />
end<br />
</syntaxhighlight><br />
<br />
'''Path File Exists'''<br />
<syntaxhighlight lang="lua"><br />
-- Path File Exists for Windows 64<br />
-- tests folder path (nil=doesn't exist, 1=exists)<br />
if application:get("pathfileexists", application:get("directory", "pictures").."/Folder01") == nil then<br />
application:set("mkDir", application:get("directory", "pictures"), "Folder01")<br />
application:set("mkDir", application:get("directory", "pictures").."/Folder01", "subfolder01")<br />
application:set("mkDir", application:get("directory", "pictures").."/Folder01", "subfolder02")<br />
end<br />
<br />
-- Path File Exists for win32<br />
-- tests folder path (nil=doesn't exist, 1=exists)<br />
if application:get("pathfileexists", application:get("directory", "pictures").."\\Folder01") == nil then<br />
-- creates it<br />
application:set("mkDir", application:get("directory", "pictures").."\\Folder01")<br />
end<br />
</syntaxhighlight><br />
<br />
{{Application}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=File:RainDrops.GApp&diff=22500File:RainDrops.GApp2023-08-29T12:09:44Z<p>Hgy29: RainDrops demo app</p>
<hr />
<div>== Summary ==<br />
RainDrops demo app</div>Hgy29https://wiki.gideros.rocks/index.php?title=Welcome!&diff=22494Welcome!2023-08-29T12:04:45Z<p>Hgy29: </p>
<hr />
<div>__NOTOC__<br />
== '''GIDEROS API REFERENCES''' ==<br />
{|-<br />
|style="width: 33%;"|<br />
::::::::::::<br />
==='''[[Lua API]]'''===<br />
=== ''' &nbsp; ''' ===<br />
<br />
|style="width: 33%;"|<br />
::::::::::::<br />
==='''[[Main API]]'''===<br />
=== ''' &nbsp; ''' ===<br />
<br />
|style="width: 33%;"|<br />
::::::::::::<br />
==='''[[Plugins]]'''===<br />
=== ''' &nbsp; ''' ===<br />
|}<br />
<br />
== '''GIDEROS GUIDES AND TUTORIALS''' ==<br />
{|-<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Tutorials ===<br />
[[Lua to Luau conversion guide]]<br/><br />
[[Start Here|You can start here]]<br/><br />
[[Article Tutorials]]<br/><br />
[[Video Tutorials]]<br/><br />
<br />
=== From the Forum ===<br />
[[Examples|Forum Snippets and more...]]<br/><br />
[[ImGui Examples|ImGui Snippets]]<br/><br />
<br />
=== Links ===<br />
[[Made With Gideros]]<br/><br />
[[Developer YouTube Channels|Developers YouTube Channels]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Ultimate Guide ===<br />
[[Introduction]]<br/><br />
[[Gideros Studio]]<br/><br />
[[Getting Started]]<br/><br />
[[Gideros Player]]<br/><br />
[[Your first code]]<br/><br />
[[Introduction to Lua]]<br/><br />
[[Classes in Gideros]]<br/><br />
[[Scene Management]]<br/><br />
[[Introduction to Graphics]]<br/><br />
[[Introduction to Graphics Shapes]]<br/><br />
[[Introduction to Fonts]]<br/><br />
[[Playing Sound and Music]]<br/><br />
[[Event system]]<br/><br />
[[File system]]<br/><br />
[[Profiling]]<br/><br />
[[Hardware and OS]]<br/><br />
[[Exporting to a Player|Exporting your project ('''Xbox, ...''')]]<br/><br />
[[Making a Plugin]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Latest ===<br />
[[Latest Release|Latest Gideros]]<br/><br />
[[Latest Luau]]<br/><br />
|}<br />
<br />
== '''GIDEROS SHORTS''' ==<br />
[[Short-Issue-1|#1 - June 2023 - Overheat]]<br />
<br />
== '''GIDEROS PEBBLES''' ==<br />
[[Lua Shaders Pebbles|Lua Shaders]]<br />
<br />
== '''GIDEROS 2D HELPERS''' ==<br />
{|-<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== UI Classes ===<br />
[[UI Buttons|UI Buttons]]<br/><br />
[[UI Color Picker|UI Color Picker]]<br/><br />
[[UI Scrollable List|UI Scrollable List]]<br/><br />
[[UI Slider|UI Sliders]]<br/><br />
[[UI Text|UI Text]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Game Helpers ===<br />
[[Scene Manager|Scene Manager/Easing]]<br/><br />
[[Game Camera]]<br/><br />
[[Animated Sprite Factory|Animations (Sprite Sheets)]]<br/><br />
[[Mobile Controls]]<br/><br />
[[Tiled Map Editor|Tiled]]<br/><br />
[[CBump Template|CBump Template]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Plugins Helpers ===<br />
[[Media Plugin]]<br/><br />
|}<br />
<br />
== '''GIDEROS 3D HELPERS''' ==<br />
{|-<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== ReactPhysics3D ===<br />
[[3D Plane]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
|}<br />
<br />
== '''GIDEROS ADVANCED''' ==<br />
{|-<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Advanced ===<br />
[[Writing Shaders]]<br/><br />
''[[Lua Shaders]]''<br/><br />
[[Compiling Gideros Source]]<br/><br />
[[Compiling Gideros Luau Source|Compiling Gideros Luau '''WIP''']]<br/><br />
[[What Does What]]<br/><br />
[[Helping With Documentation]]<br/><br />
[[CPlusPlus for Gideros Studio Help]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
=== Wiki Special Links ===<br />
[[Special:AllPages]]<br/><br />
[[All Classes and more]]<br/><br />
[[Wiki Sandbox]]<br/><br />
<br />
|style="width: 30%; vertical-align:top;"|<br />
:::::::::::<br />
|}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Compiling_Gideros_Source&diff=22489Compiling Gideros Source2023-08-23T15:26:45Z<p>Hgy29: /* 1.3.1 (Linux/Debian) Install Git, build-tools */</p>
<hr />
<div>The following instructions are for developers who want to contribute to or otherwise experiment with the Gideros C/C++ engine and are ''not'' necessary for either building or deploying apps made with Gideros.<br />
<br />
The Gideros project consists of the Gideros Studio IDE, the Gideros SDK libraries, Gideros Texture Packer, Gideros Font Creator, "players" or export templates for all the platforms Gideros supports, all targets of all plugins, a daemon and a bridge. The build system is flexible, so you only need the tools for the targets you are interested in deploying to with Qt (and MSYS2 on Windows) being a realistic minimum.<br />
<br />
<div class="noautonum">__TOC__</div><br />
<br />
== 1. Requirements ==<br />
=== 1.1 Install QT ===<br />
https://www.qt.io/download-open-source/<br />
<br />
Recommended version 6.3 with MinGW <br /><br />
<br />
Double click on the downloaded file and follow instructions. When installing, expand the tree view and ensure you have ticked the MinGW child option of the Qt version checkbox, as well as the MinGW option in the Tools section.<br />
Beside main QT package, you'll need the following additional components:<br />
* WebSocket additional library<br />
* Multimedia additional library<br />
* Qt5 Compatibility addon<br />
<br />
(MAC) Move the created folder into your user account folder <br />
<br />
(LINUX) <br />
On Debian 11:<br />
echo "deb http://deb.debian.org/debian bullseye-backports main" >>/etc/apt/sources.list<br />
apt update<br />
apt install qt6-base-dev qt6-websockets-dev qt6-multimedia-dev qt6-5compat-dev<br />
<br />
Depending on your distribution, you may need to install qt5 websocket lib seperately (sudo apt-get install libqt5websockets5-dev)<br />
<br />
------<br />
<br />
===1.2 (PC) Install MSYS2 Console===<br />
https://msys2.github.io/ <br />
<br />
Double click on the downloaded file (msys2-i686) and follow instructions. <br />
<br />
Open 32 bit MSYS2 shell: msys2_shell.cmd<br />
<syntaxhighlight lang="bash"><br />
pacman -Sy pacman<br />
pacman -Syu<br />
pacman -Su<br />
pacman -S tar<br />
pacman -S zip<br />
pacman -S unzip<br />
pacman -S git<br />
pacman -S base-devel<br />
pacman -S python<br />
#For compiling win32/32bit under a MinGW64<br />
pacman -S mingw-w64-i686-toolchain<br />
pacman -S mingw-w64-i686-glew<br />
pacman -S mingw-w64-i686-curl<br />
pacman -S mingw-w64-i686-libpng<br />
#For compiling win32/64bit under a MinGW64<br />
pacman -S mingw-w64-x86_64-toolchain<br />
pacman -S mingw-w64-x86_64-glew<br />
pacman -S mingw-w64-x86_64-curl<br />
pacman -S mingw-w64-x86_64-libpng<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.3 (Mac) Install Git & xcpretty ===<br />
http://git-scm.com/downloads<br />
<br />
Ctrl + right click, open with « Install program.app » Follow instructions keeping default values as they are. <br />
<br />
(MAC) open a terminal window <br />
<syntaxhighlight lang="bash"><br />
git config -global user.name "your git login" <br />
git config -global user.email "your git email"<br />
sudo gem install xcpretty<br />
</syntaxhighlight><br />
------<br />
=== 1.3.1 (Linux/Debian) Install Git, build-tools ===<br />
<syntaxhighlight lang="bash"><br />
apt install git build-essential libxcb-xinerama0 libgl1-mesa-dev libz-dev libasound2-dev libglew-dev libglfw3-dev libcurl4-openssl-dev patchelf zip<br />
git config --global user.email "your git email"<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.4 (PC) Android requirements ===<br />
<br />
==== 1.4.1 Install Android Studio and NDK ====<br />
<br />
https://developer.android.com/studio/index.html<br />
https://developer.android.com/ndk/downloads/older_releases.html<br />
<br />
Recommended NDK is 25c (the x86_64 version)<br />
<br />
Once downloaded, copy the contents of the NDK to your home or C: folder, rename the folder that you copied to 'android-ndk', for example you will end up with 'c:\android-ndk' and below that folders that say build, meta, platforms, etc.<br />
<br />
==== 1.4.2 Install Ant (no longer required but kept util someone confirms this)====<br />
https://ant.apache.org/<br />
<br />
Once downloaded, copy the contents of the install archive/zip file to your home folder or C: drive.<br />
Eg: so you have a folder called c:\apache-ant-1.10.5 with bin, etc, lib, manual folders within that.<br />
<br />
==== 1.4.3 Mix Old and New Tools (no longer required but kept util someone confirms this) ====<br />
<br />
Gideros uses Ant to build the player, unfortunately the tools to support Ant are now missing from the latest Android tools.<br />
<br />
<br />
There is a fix for this:<br />
<br />
# Rename the existing 'tools' folder in the Android SDK folder to 'tools_new'.<br />
# Download an older (March 2016) version of the tools and copy that folder to the Android SDK folder.<br />
# Copy the contents of 'tools_new' over the contents of 'tools'.<br />
<br />
Here is where you can download the compatible set of tools from:<br />
<br />
(PC) https://dl.google.com/android/repository/tools_r25.2.5-windows.zip<br />
<br />
(MAC) https://dl.google.com/android/repository/tools_r25.2.5-macosx.zip<br />
<br />
(LINUX) https://dl.google.com/android/repository/tools_r25.2.5-linux.zip<br />
<br />
------<br />
<br />
=== 1.5 Install Java ===<br />
You need the Java JDK<br />
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html<br />
<br />
------<br />
<br />
=== 1.6 (PC) Install Visual Studio ===<br />
https://www.visualstudio.com/downloads/<br />
<br />
Install [https://developer.microsoft.com/en-us/windows/downloads/windows-8-1-sdk Win 8.1 SDK]<br />
<br />
Install [https://marketplace.visualstudio.com/items?itemName=AdMediator.MicrosoftAdvertisingSDKforWindowsandWindowsPhone8x Microsoft Advertising SDK for Windows and Windows Phone 8.x]<br />
<br />
Ensure that you have MSBuild v12 or v14 installed (building with the makefile will fail with an incorrect version).<br />
<br />
------<br />
<br />
=== 1.7 (MAC) Install Xcode ===<br />
https://itunes.apple.com/fr/app/xcode/id497799835?mt=12<br />
<br />
------<br />
<br />
=== 1.8 (Mac) ensure xcode command line tools are working ===<br />
(MAC) Open a terminal window <br />
<syntaxhighlight lang="bash"><br />
sudo xCodebuild -license <br />
quit<br />
agree<br />
</syntaxhighlight><br />
<br /><br />
------<br />
<br />
=== 1.9 Install Python ===<br />
https://www.python.org/downloads/release/python-2712/<br />
<br />
You need Python 2.7.12 or later to install emscripten properly.<br />
<br />
Once installed, add it to your command line path, eg: c:\python27, on windows you can do this by right-clicking on 'myComputer' or 'This PC', go to 'Properties', click 'Advanced System Settings', Click 'Environmental Variables', double-click 'Path', add 'c:\python27'.<br />
<br />
------<br />
<br />
=== 1.10 Install emscripten ===<br />
http://kripken.github.io/emscripten-site/<br />
<br />
You need this is you want to build for HTML5 + Facebook games.<br />
<br />
Using a shell or MSYS2 (previously installed) on windows, go to your home or C: folder and type:<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/juj/emsdk.git<br />
</syntaxhighlight><br />
<br />
Once that has completed open a command prompt in that folder on Windows, on other system just cd to the folder.<br />
<br />
Using emsdk, install and activate all the latest packages:<br />
<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install latest<br />
emsdk activate latest<br />
</syntaxhighlight><br />
<br />
(PC) Type:<br />
<syntaxhighlight lang="bash"><br />
emsdk_env.bat<br />
</syntaxhighlight><br />
<br />
(MAC) Type:<br />
<syntaxhighlight lang="bash"><br />
source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
To use incoming branch of emscripten, use these commands instead:<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install sdk-incoming-64bit<br />
emsdk activate sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
To further use Gideros own git fork of emscripten:<br />
<syntaxhighlight lang="bash"><br />
cd emscripten/incoming<br />
# Add a git remote link to your own repository.<br />
git remote add gideros https://github.com/gideros/emscripten.git<br />
# Obtain the changes in your link.<br />
git fetch gideros<br />
# Switch the emscripten-incoming tool to use your fork.<br />
git checkout -b gideros_incoming --track gideros/incoming<br />
#Get back to emscripten directory and rebuild<br />
cd ../..<br />
emsdk install sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
<br />
These can also be installed within emsdk: git, crunch, and spidermonkey<br />
<syntaxhighlight lang="bash"><br />
(on non-PC put ./ before emsdk)<br />
emsdk install git-1.9.4<br />
emsdk install crunch-1.03<br />
emsdk install spidermonkey-37.0.1-64bit<br />
emsdk activate git-1.9.4<br />
emsdk activate crunch-1.03<br />
emsdk activate spidermonkey-37.0.1-64bit<br />
(PC) emsdk_env.bat<br />
(MAC) source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
(PC) Make sure the environment variable EM_CONFIG is set to the location of your emscripten config file.<br />
<br />
The emscripten build also needs the CMake command. You can download it and extract it to your home or C: folder. Don't forget to add it's path to the end of the EMSDKPATH in Makefile.def.<br />
<br />
https://cmake.org/download/<br />
<br />
------<br />
<br />
=== 1.11 Install Steam SDK ===<br />
https://partner.steamgames.com/?goto=%2Fdownloads%2Fsteamworks_sdk.zip<br />
<br />
Extract the archive/zip file to your home or C: folder, for example if the file is called 'steamworks_sdk_142.zip' then you will have a 'c:\steamworks_sdk_142' folder with a solder called 'sdk' within it. The sdk folder contains other folders such as glmgr, public, tools, etc.<br />
<br />
This is necessary for the Steam plugin.<br />
<br />
------<br />
<br />
=== 1.12 Install Gideros ===<br />
<br />
==== 1.12.1 Fetch gideros source code ====<br />
(PC) Open MSYS2 32 bit shell<br />
<br />
(MAC/Linux) Open a terminal<br />
<br />
Navigate to the folder where you into to work.<br />
<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/gideros/gideros <br />
</syntaxhighlight><br />
<br />
==== 1.12.2 Configure scripts ====<br />
Make a copy of the file gideros/scripts/Makefile.def.example, rename it to Makefile.def and update the file copy according <br />
to your installation. Ensure that the QT\_ARCH and QT_TOOLSARCH paths are formatted correctly according to your Qt <br />
install directory structure (see below that they are named differently by Qt).<br />
<br />
''''''Example:''''''<br />
<br/><br />
'''On PC:'''<br />
<br />
For Qt:<syntaxhighlight lang="bash>QTBASEDIR=/c/Qt<br />
QT_ARCH=mingw53_32<br />
QT_TOOLSARCH=mingw530_32<br />
QTVER=5.9.1<br />
QT5ICUVER=59<br />
<br />
STEAMSDK=/c/Applications/steamworks_sdk_142<br />
export STEAMSDK<br />
</syntaxhighlight><br />
<br/><br />
For Android:<br />
<br />
<syntaxhighlight lang="bash"><br />
# on Windows, also add this to PATH<br />
NDK_HOME=/c/android/android-ndk-r17b<br />
NDKBUILD=cmd //c /c/android/android-ndk-r17b/ndk-build.cmd<br />
#We use windows syntax for this one, as it will be used by gradle.bat script<br />
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144<br />
#Windows syntax with quadruple backslashs!<br />
ANDROID_HOME=C:\\\\Users\\\\Gideros\\\\AppData\\\\Local\\\\Android\\\\sdk<br />
<br />
</syntaxhighlight><br />
<br/><br />
For WinRT:<br />
<br />
<syntaxhighlight lang="bash"><br />
FXC="/c/Program Files (x86)/Windows Kits/8.1/bin/x86/fxc.exe" <br />
MSBUILD="/c/Program Files (x86)/MSBuild/14.0/Bin/MSbuild.exe" <br />
</syntaxhighlight><br />
<br/><br />
<br />
For html5:<br />
<br />
<syntaxhighlight lang="bash"><br />
EMSDK=/c/emsdkwin<br />
EMSDKPATH=$(EMSDK):$(EMSDK)/clang/e1.35.0_64bit:$(EMSDK)/node/4.1.1_64bit/bin:$(EMSDK)/python/2.7.5.3_64bit:$(EMSDK)/emscripten/1.35.0<br />
EMSDK_PREFIX=PATH=$(EMSDKPATH):$$$$PATH cmd //c<br />
CRUNCHME=crunchme-win32.exe<br />
</syntaxhighlight><br />
<br/><br />
'''On MAC:''' <br />
<br />
<syntaxhighlight lang="bash"><br />
QTBASEDIR=~/Qt QT_ARCH=clang_64 <br />
QT_TOOLSARCH=clang_64 <br />
QTVER=5.8 <br />
QT5ICUVER=54 #deprecated stuff <br />
</syntaxhighlight><br />
<br />
'''On Linux:''' <br />
(tested on Debian 11)<br />
<syntaxhighlight lang="bash"><br />
QT=/usr<br />
QMAKE=qmake6<br />
QTLIBS=/lib/x86_64-linux-gnu<br />
QTPLUGINS=$(QTLIBS)/qt6/plugins<br />
</syntaxhighlight><br />
<br />
==== 1.12.3 Complete working example Makefile.def for Windows ====<br />
<br />
Here is a working example, you will have to change the filename details to match your setup:<br />
<br />
[[Example Makefile.def file|example Makefile.def file]].<br />
<br />
==== 1.12.4 Fetch additional repositories ====<br />
<br />
Go into just cloned gideros source folder and run make prep.repo<br />
<syntaxhighlight lang="bash"><br />
cd gideros<br />
make -f scripts/Makefile.gid prep.repo <br />
</syntaxhighlight><br />
<br />
If you intend to build the studio, you'll need scintilla and Lexilla libraries. Compile them now with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid qlexilla<br />
make -f scripts/Makefile.gid qscintilla<br />
</syntaxhighlight><br />
<br />
------<br />
<br />
== 2. Building ==<br />
<br />
If you have all dependencies in place for all targets, you can build everything at once via MSYS2 or Terminal with:<br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid<br />
</pre><br />
<br />
=== 2.1 Compilation on PC :===<br />
<br />
Open MSYS2 shell (msys2_shell.cmd). Standard compilation is 32 bit so use a 32 bit shell. Make sure you have installed the necessary build tools in MSYS2 using pacman, as detailed in [[#1.2 (PC) Install MSYS2 Console|Install MSYS2 Console]].<br />
.<br />
<br />
Navigate to gideros folder <br />
<br />
==== 2.1.1 Build QT tools : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid qtapp.install<br />
</pre><br />
<br />
-> files GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in Build.Win folder <br />
<br />
==== 2.1.2 Android: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid android.install <br />
</pre><br />
<br />
= file GiderosAndroidPlayer.apk in folder Build.Win/Players <br />
<br />
==== 2.1.3 winRT: ====<br />
<br />
''If necessary :''<br />
Open the solution, gideros/winRT_example/giderosgame.sln in Visual Studio. Check that the SQLite version for Windows and Windows Phone is up to date. Save and close the solution. <br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid winrt.install <br />
</pre><br />
<br />
= file _bundle.appxupload in folder Build.Win/Players/WinRT<br />
<br />
==== 2.1.4 win32: ====<br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid win32.install <br />
</pre><br />
<br />
= files in folder Build.Win/Templates/win32 <br />
<br />
==== 2.1.5 Html5: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid html5.install<br />
</pre><br />
<br />
-> files in folders Build.Win//Players/Html5 and Build.Win/Templates/Html5<br />
<br />
==== 2.1.6 Plugins: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid bundle.win <br />
</pre><br />
<br />
= folder bin and file gplugin in folder Build.Win/All Plugins<br />
<br />
==== 2.1.7 To build everything that can be built on Windows ====<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid all<br />
</syntaxhighlight><br />
<br />
Then you need to copy all the plugins to the 'Build.Win' folder with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid bundle.win<br />
</syntaxhighlight><br />
<br />
=== 2.2 Compilation on Mac :===<br />
Open Terminal. <br />
<br />
cd to the folder « gideros » <br />
<br />
==== 2.2.1 QT : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid qtapp.install <br />
</pre><br />
<br />
= GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in folder Build.Mac <br />
<br />
==== 2.2.2 iOS : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid ios.install <br />
</pre><br />
<br />
= GiderosiOSPlayer.zip in folder Buid.Mac/Players <br />
<br />
==== 2.2.3 Plugins: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid bundle.mac <br />
</pre><br />
<br />
= folders bin and files gplugin in folder Buid.Mac/All Plugins<br />
<br />
------<br />
<br />
== 3. Cleaning ==<br />
<br />
If you want to reset the build process and start again then you can issue a 'clean' command. To do this type 'make -f scripts/Makefile.gid clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid clean<br />
</syntaxhighlight><br />
<br />
<br />
Sometimes you need to make a clean a particular build. To do this type 'make -f scripts/Makefile.gid ' followed by something like 'html5' then '.clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid html5.clean<br />
</syntaxhighlight></div>Hgy29https://wiki.gideros.rocks/index.php?title=Compiling_Gideros_Source&diff=22487Compiling Gideros Source2023-08-22T12:28:50Z<p>Hgy29: /* 1.3.1 (Linux/Debian) Install Git, build-tools */</p>
<hr />
<div>The following instructions are for developers who want to contribute to or otherwise experiment with the Gideros C/C++ engine and are ''not'' necessary for either building or deploying apps made with Gideros.<br />
<br />
The Gideros project consists of the Gideros Studio IDE, the Gideros SDK libraries, Gideros Texture Packer, Gideros Font Creator, "players" or export templates for all the platforms Gideros supports, all targets of all plugins, a daemon and a bridge. The build system is flexible, so you only need the tools for the targets you are interested in deploying to with Qt (and MSYS2 on Windows) being a realistic minimum.<br />
<br />
<div class="noautonum">__TOC__</div><br />
<br />
== 1. Requirements ==<br />
=== 1.1 Install QT ===<br />
https://www.qt.io/download-open-source/<br />
<br />
Recommended version 6.3 with MinGW <br /><br />
<br />
Double click on the downloaded file and follow instructions. When installing, expand the tree view and ensure you have ticked the MinGW child option of the Qt version checkbox, as well as the MinGW option in the Tools section.<br />
Beside main QT package, you'll need the following additional components:<br />
* WebSocket additional library<br />
* Multimedia additional library<br />
* Qt5 Compatibility addon<br />
<br />
(MAC) Move the created folder into your user account folder <br />
<br />
(LINUX) <br />
On Debian 11:<br />
echo "deb http://deb.debian.org/debian bullseye-backports main" >>/etc/apt/sources.list<br />
apt update<br />
apt install qt6-base-dev qt6-websockets-dev qt6-multimedia-dev qt6-5compat-dev<br />
<br />
Depending on your distribution, you may need to install qt5 websocket lib seperately (sudo apt-get install libqt5websockets5-dev)<br />
<br />
------<br />
<br />
===1.2 (PC) Install MSYS2 Console===<br />
https://msys2.github.io/ <br />
<br />
Double click on the downloaded file (msys2-i686) and follow instructions. <br />
<br />
Open 32 bit MSYS2 shell: msys2_shell.cmd<br />
<syntaxhighlight lang="bash"><br />
pacman -Sy pacman<br />
pacman -Syu<br />
pacman -Su<br />
pacman -S tar<br />
pacman -S zip<br />
pacman -S unzip<br />
pacman -S git<br />
pacman -S base-devel<br />
pacman -S python<br />
#For compiling win32/32bit under a MinGW64<br />
pacman -S mingw-w64-i686-toolchain<br />
pacman -S mingw-w64-i686-glew<br />
pacman -S mingw-w64-i686-curl<br />
pacman -S mingw-w64-i686-libpng<br />
#For compiling win32/64bit under a MinGW64<br />
pacman -S mingw-w64-x86_64-toolchain<br />
pacman -S mingw-w64-x86_64-glew<br />
pacman -S mingw-w64-x86_64-curl<br />
pacman -S mingw-w64-x86_64-libpng<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.3 (Mac) Install Git & xcpretty ===<br />
http://git-scm.com/downloads<br />
<br />
Ctrl + right click, open with « Install program.app » Follow instructions keeping default values as they are. <br />
<br />
(MAC) open a terminal window <br />
<syntaxhighlight lang="bash"><br />
git config -global user.name "your git login" <br />
git config -global user.email "your git email"<br />
sudo gem install xcpretty<br />
</syntaxhighlight><br />
------<br />
=== 1.3.1 (Linux/Debian) Install Git, build-tools ===<br />
<syntaxhighlight lang="bash"><br />
apt install git build-essential libxcb-xinerama0 libgl1-mesa-dev libz-dev libasound2-dev libglew-dev libglfw3-dev libcurl4-openssl-dev patchelf<br />
git config --global user.email "your git email"<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.4 (PC) Android requirements ===<br />
<br />
==== 1.4.1 Install Android Studio and NDK ====<br />
<br />
https://developer.android.com/studio/index.html<br />
https://developer.android.com/ndk/downloads/older_releases.html<br />
<br />
Recommended NDK is 25c (the x86_64 version)<br />
<br />
Once downloaded, copy the contents of the NDK to your home or C: folder, rename the folder that you copied to 'android-ndk', for example you will end up with 'c:\android-ndk' and below that folders that say build, meta, platforms, etc.<br />
<br />
==== 1.4.2 Install Ant (no longer required but kept util someone confirms this)====<br />
https://ant.apache.org/<br />
<br />
Once downloaded, copy the contents of the install archive/zip file to your home folder or C: drive.<br />
Eg: so you have a folder called c:\apache-ant-1.10.5 with bin, etc, lib, manual folders within that.<br />
<br />
==== 1.4.3 Mix Old and New Tools (no longer required but kept util someone confirms this) ====<br />
<br />
Gideros uses Ant to build the player, unfortunately the tools to support Ant are now missing from the latest Android tools.<br />
<br />
<br />
There is a fix for this:<br />
<br />
# Rename the existing 'tools' folder in the Android SDK folder to 'tools_new'.<br />
# Download an older (March 2016) version of the tools and copy that folder to the Android SDK folder.<br />
# Copy the contents of 'tools_new' over the contents of 'tools'.<br />
<br />
Here is where you can download the compatible set of tools from:<br />
<br />
(PC) https://dl.google.com/android/repository/tools_r25.2.5-windows.zip<br />
<br />
(MAC) https://dl.google.com/android/repository/tools_r25.2.5-macosx.zip<br />
<br />
(LINUX) https://dl.google.com/android/repository/tools_r25.2.5-linux.zip<br />
<br />
------<br />
<br />
=== 1.5 Install Java ===<br />
You need the Java JDK<br />
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html<br />
<br />
------<br />
<br />
=== 1.6 (PC) Install Visual Studio ===<br />
https://www.visualstudio.com/downloads/<br />
<br />
Install [https://developer.microsoft.com/en-us/windows/downloads/windows-8-1-sdk Win 8.1 SDK]<br />
<br />
Install [https://marketplace.visualstudio.com/items?itemName=AdMediator.MicrosoftAdvertisingSDKforWindowsandWindowsPhone8x Microsoft Advertising SDK for Windows and Windows Phone 8.x]<br />
<br />
Ensure that you have MSBuild v12 or v14 installed (building with the makefile will fail with an incorrect version).<br />
<br />
------<br />
<br />
=== 1.7 (MAC) Install Xcode ===<br />
https://itunes.apple.com/fr/app/xcode/id497799835?mt=12<br />
<br />
------<br />
<br />
=== 1.8 (Mac) ensure xcode command line tools are working ===<br />
(MAC) Open a terminal window <br />
<syntaxhighlight lang="bash"><br />
sudo xCodebuild -license <br />
quit<br />
agree<br />
</syntaxhighlight><br />
<br /><br />
------<br />
<br />
=== 1.9 Install Python ===<br />
https://www.python.org/downloads/release/python-2712/<br />
<br />
You need Python 2.7.12 or later to install emscripten properly.<br />
<br />
Once installed, add it to your command line path, eg: c:\python27, on windows you can do this by right-clicking on 'myComputer' or 'This PC', go to 'Properties', click 'Advanced System Settings', Click 'Environmental Variables', double-click 'Path', add 'c:\python27'.<br />
<br />
------<br />
<br />
=== 1.10 Install emscripten ===<br />
http://kripken.github.io/emscripten-site/<br />
<br />
You need this is you want to build for HTML5 + Facebook games.<br />
<br />
Using a shell or MSYS2 (previously installed) on windows, go to your home or C: folder and type:<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/juj/emsdk.git<br />
</syntaxhighlight><br />
<br />
Once that has completed open a command prompt in that folder on Windows, on other system just cd to the folder.<br />
<br />
Using emsdk, install and activate all the latest packages:<br />
<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install latest<br />
emsdk activate latest<br />
</syntaxhighlight><br />
<br />
(PC) Type:<br />
<syntaxhighlight lang="bash"><br />
emsdk_env.bat<br />
</syntaxhighlight><br />
<br />
(MAC) Type:<br />
<syntaxhighlight lang="bash"><br />
source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
To use incoming branch of emscripten, use these commands instead:<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install sdk-incoming-64bit<br />
emsdk activate sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
To further use Gideros own git fork of emscripten:<br />
<syntaxhighlight lang="bash"><br />
cd emscripten/incoming<br />
# Add a git remote link to your own repository.<br />
git remote add gideros https://github.com/gideros/emscripten.git<br />
# Obtain the changes in your link.<br />
git fetch gideros<br />
# Switch the emscripten-incoming tool to use your fork.<br />
git checkout -b gideros_incoming --track gideros/incoming<br />
#Get back to emscripten directory and rebuild<br />
cd ../..<br />
emsdk install sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
<br />
These can also be installed within emsdk: git, crunch, and spidermonkey<br />
<syntaxhighlight lang="bash"><br />
(on non-PC put ./ before emsdk)<br />
emsdk install git-1.9.4<br />
emsdk install crunch-1.03<br />
emsdk install spidermonkey-37.0.1-64bit<br />
emsdk activate git-1.9.4<br />
emsdk activate crunch-1.03<br />
emsdk activate spidermonkey-37.0.1-64bit<br />
(PC) emsdk_env.bat<br />
(MAC) source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
(PC) Make sure the environment variable EM_CONFIG is set to the location of your emscripten config file.<br />
<br />
The emscripten build also needs the CMake command. You can download it and extract it to your home or C: folder. Don't forget to add it's path to the end of the EMSDKPATH in Makefile.def.<br />
<br />
https://cmake.org/download/<br />
<br />
------<br />
<br />
=== 1.11 Install Steam SDK ===<br />
https://partner.steamgames.com/?goto=%2Fdownloads%2Fsteamworks_sdk.zip<br />
<br />
Extract the archive/zip file to your home or C: folder, for example if the file is called 'steamworks_sdk_142.zip' then you will have a 'c:\steamworks_sdk_142' folder with a solder called 'sdk' within it. The sdk folder contains other folders such as glmgr, public, tools, etc.<br />
<br />
This is necessary for the Steam plugin.<br />
<br />
------<br />
<br />
=== 1.12 Install Gideros ===<br />
<br />
==== 1.12.1 Fetch gideros source code ====<br />
(PC) Open MSYS2 32 bit shell<br />
<br />
(MAC/Linux) Open a terminal<br />
<br />
Navigate to the folder where you into to work.<br />
<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/gideros/gideros <br />
</syntaxhighlight><br />
<br />
==== 1.12.2 Configure scripts ====<br />
Make a copy of the file gideros/scripts/Makefile.def.example, rename it to Makefile.def and update the file copy according <br />
to your installation. Ensure that the QT\_ARCH and QT_TOOLSARCH paths are formatted correctly according to your Qt <br />
install directory structure (see below that they are named differently by Qt).<br />
<br />
''''''Example:''''''<br />
<br/><br />
'''On PC:'''<br />
<br />
For Qt:<syntaxhighlight lang="bash>QTBASEDIR=/c/Qt<br />
QT_ARCH=mingw53_32<br />
QT_TOOLSARCH=mingw530_32<br />
QTVER=5.9.1<br />
QT5ICUVER=59<br />
<br />
STEAMSDK=/c/Applications/steamworks_sdk_142<br />
export STEAMSDK<br />
</syntaxhighlight><br />
<br/><br />
For Android:<br />
<br />
<syntaxhighlight lang="bash"><br />
# on Windows, also add this to PATH<br />
NDK_HOME=/c/android/android-ndk-r17b<br />
NDKBUILD=cmd //c /c/android/android-ndk-r17b/ndk-build.cmd<br />
#We use windows syntax for this one, as it will be used by gradle.bat script<br />
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144<br />
#Windows syntax with quadruple backslashs!<br />
ANDROID_HOME=C:\\\\Users\\\\Gideros\\\\AppData\\\\Local\\\\Android\\\\sdk<br />
<br />
</syntaxhighlight><br />
<br/><br />
For WinRT:<br />
<br />
<syntaxhighlight lang="bash"><br />
FXC="/c/Program Files (x86)/Windows Kits/8.1/bin/x86/fxc.exe" <br />
MSBUILD="/c/Program Files (x86)/MSBuild/14.0/Bin/MSbuild.exe" <br />
</syntaxhighlight><br />
<br/><br />
<br />
For html5:<br />
<br />
<syntaxhighlight lang="bash"><br />
EMSDK=/c/emsdkwin<br />
EMSDKPATH=$(EMSDK):$(EMSDK)/clang/e1.35.0_64bit:$(EMSDK)/node/4.1.1_64bit/bin:$(EMSDK)/python/2.7.5.3_64bit:$(EMSDK)/emscripten/1.35.0<br />
EMSDK_PREFIX=PATH=$(EMSDKPATH):$$$$PATH cmd //c<br />
CRUNCHME=crunchme-win32.exe<br />
</syntaxhighlight><br />
<br/><br />
'''On MAC:''' <br />
<br />
<syntaxhighlight lang="bash"><br />
QTBASEDIR=~/Qt QT_ARCH=clang_64 <br />
QT_TOOLSARCH=clang_64 <br />
QTVER=5.8 <br />
QT5ICUVER=54 #deprecated stuff <br />
</syntaxhighlight><br />
<br />
'''On Linux:''' <br />
(tested on Debian 11)<br />
<syntaxhighlight lang="bash"><br />
QT=/usr<br />
QMAKE=qmake6<br />
QTLIBS=/lib/x86_64-linux-gnu<br />
QTPLUGINS=$(QTLIBS)/qt6/plugins<br />
</syntaxhighlight><br />
<br />
==== 1.12.3 Complete working example Makefile.def for Windows ====<br />
<br />
Here is a working example, you will have to change the filename details to match your setup:<br />
<br />
[[Example Makefile.def file|example Makefile.def file]].<br />
<br />
==== 1.12.4 Fetch additional repositories ====<br />
<br />
Go into just cloned gideros source folder and run make prep.repo<br />
<syntaxhighlight lang="bash"><br />
cd gideros<br />
make -f scripts/Makefile.gid prep.repo <br />
</syntaxhighlight><br />
<br />
If you intend to build the studio, you'll need scintilla and Lexilla libraries. Compile them now with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid qlexilla<br />
make -f scripts/Makefile.gid qscintilla<br />
</syntaxhighlight><br />
<br />
------<br />
<br />
== 2. Building ==<br />
<br />
If you have all dependencies in place for all targets, you can build everything at once via MSYS2 or Terminal with:<br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid<br />
</pre><br />
<br />
=== 2.1 Compilation on PC :===<br />
<br />
Open MSYS2 shell (msys2_shell.cmd). Standard compilation is 32 bit so use a 32 bit shell. Make sure you have installed the necessary build tools in MSYS2 using pacman, as detailed in [[#1.2 (PC) Install MSYS2 Console|Install MSYS2 Console]].<br />
.<br />
<br />
Navigate to gideros folder <br />
<br />
==== 2.1.1 Build QT tools : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid qtapp.install<br />
</pre><br />
<br />
-> files GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in Build.Win folder <br />
<br />
==== 2.1.2 Android: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid android.install <br />
</pre><br />
<br />
= file GiderosAndroidPlayer.apk in folder Build.Win/Players <br />
<br />
==== 2.1.3 winRT: ====<br />
<br />
''If necessary :''<br />
Open the solution, gideros/winRT_example/giderosgame.sln in Visual Studio. Check that the SQLite version for Windows and Windows Phone is up to date. Save and close the solution. <br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid winrt.install <br />
</pre><br />
<br />
= file _bundle.appxupload in folder Build.Win/Players/WinRT<br />
<br />
==== 2.1.4 win32: ====<br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid win32.install <br />
</pre><br />
<br />
= files in folder Build.Win/Templates/win32 <br />
<br />
==== 2.1.5 Html5: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid html5.install<br />
</pre><br />
<br />
-> files in folders Build.Win//Players/Html5 and Build.Win/Templates/Html5<br />
<br />
==== 2.1.6 Plugins: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid bundle.win <br />
</pre><br />
<br />
= folder bin and file gplugin in folder Build.Win/All Plugins<br />
<br />
==== 2.1.7 To build everything that can be built on Windows ====<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid all<br />
</syntaxhighlight><br />
<br />
Then you need to copy all the plugins to the 'Build.Win' folder with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid bundle.win<br />
</syntaxhighlight><br />
<br />
=== 2.2 Compilation on Mac :===<br />
Open Terminal. <br />
<br />
cd to the folder « gideros » <br />
<br />
==== 2.2.1 QT : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid qtapp.install <br />
</pre><br />
<br />
= GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in folder Build.Mac <br />
<br />
==== 2.2.2 iOS : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid ios.install <br />
</pre><br />
<br />
= GiderosiOSPlayer.zip in folder Buid.Mac/Players <br />
<br />
==== 2.2.3 Plugins: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid bundle.mac <br />
</pre><br />
<br />
= folders bin and files gplugin in folder Buid.Mac/All Plugins<br />
<br />
------<br />
<br />
== 3. Cleaning ==<br />
<br />
If you want to reset the build process and start again then you can issue a 'clean' command. To do this type 'make -f scripts/Makefile.gid clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid clean<br />
</syntaxhighlight><br />
<br />
<br />
Sometimes you need to make a clean a particular build. To do this type 'make -f scripts/Makefile.gid ' followed by something like 'html5' then '.clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid html5.clean<br />
</syntaxhighlight></div>Hgy29https://wiki.gideros.rocks/index.php?title=Compiling_Gideros_Source&diff=22486Compiling Gideros Source2023-08-21T13:45:18Z<p>Hgy29: /* 1.3.1 (Linux/Debian) Install Git, build-tools */</p>
<hr />
<div>The following instructions are for developers who want to contribute to or otherwise experiment with the Gideros C/C++ engine and are ''not'' necessary for either building or deploying apps made with Gideros.<br />
<br />
The Gideros project consists of the Gideros Studio IDE, the Gideros SDK libraries, Gideros Texture Packer, Gideros Font Creator, "players" or export templates for all the platforms Gideros supports, all targets of all plugins, a daemon and a bridge. The build system is flexible, so you only need the tools for the targets you are interested in deploying to with Qt (and MSYS2 on Windows) being a realistic minimum.<br />
<br />
<div class="noautonum">__TOC__</div><br />
<br />
== 1. Requirements ==<br />
=== 1.1 Install QT ===<br />
https://www.qt.io/download-open-source/<br />
<br />
Recommended version 6.3 with MinGW <br /><br />
<br />
Double click on the downloaded file and follow instructions. When installing, expand the tree view and ensure you have ticked the MinGW child option of the Qt version checkbox, as well as the MinGW option in the Tools section.<br />
Beside main QT package, you'll need the following additional components:<br />
* WebSocket additional library<br />
* Multimedia additional library<br />
* Qt5 Compatibility addon<br />
<br />
(MAC) Move the created folder into your user account folder <br />
<br />
(LINUX) <br />
On Debian 11:<br />
echo "deb http://deb.debian.org/debian bullseye-backports main" >>/etc/apt/sources.list<br />
apt update<br />
apt install qt6-base-dev qt6-websockets-dev qt6-multimedia-dev qt6-5compat-dev<br />
<br />
Depending on your distribution, you may need to install qt5 websocket lib seperately (sudo apt-get install libqt5websockets5-dev)<br />
<br />
------<br />
<br />
===1.2 (PC) Install MSYS2 Console===<br />
https://msys2.github.io/ <br />
<br />
Double click on the downloaded file (msys2-i686) and follow instructions. <br />
<br />
Open 32 bit MSYS2 shell: msys2_shell.cmd<br />
<syntaxhighlight lang="bash"><br />
pacman -Sy pacman<br />
pacman -Syu<br />
pacman -Su<br />
pacman -S tar<br />
pacman -S zip<br />
pacman -S unzip<br />
pacman -S git<br />
pacman -S base-devel<br />
pacman -S python<br />
#For compiling win32/32bit under a MinGW64<br />
pacman -S mingw-w64-i686-toolchain<br />
pacman -S mingw-w64-i686-glew<br />
pacman -S mingw-w64-i686-curl<br />
pacman -S mingw-w64-i686-libpng<br />
#For compiling win32/64bit under a MinGW64<br />
pacman -S mingw-w64-x86_64-toolchain<br />
pacman -S mingw-w64-x86_64-glew<br />
pacman -S mingw-w64-x86_64-curl<br />
pacman -S mingw-w64-x86_64-libpng<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.3 (Mac) Install Git & xcpretty ===<br />
http://git-scm.com/downloads<br />
<br />
Ctrl + right click, open with « Install program.app » Follow instructions keeping default values as they are. <br />
<br />
(MAC) open a terminal window <br />
<syntaxhighlight lang="bash"><br />
git config -global user.name "your git login" <br />
git config -global user.email "your git email"<br />
sudo gem install xcpretty<br />
</syntaxhighlight><br />
------<br />
=== 1.3.1 (Linux/Debian) Install Git, build-tools ===<br />
<syntaxhighlight lang="bash"><br />
apt install git build-essential libxcb-xinerama0 libgl1-mesa-dev libz-dev libasound2-dev libglew-dev libglfw3-dev libcurl4-openssl-dev<br />
git config --global user.email "your git email"<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.4 (PC) Android requirements ===<br />
<br />
==== 1.4.1 Install Android Studio and NDK ====<br />
<br />
https://developer.android.com/studio/index.html<br />
https://developer.android.com/ndk/downloads/older_releases.html<br />
<br />
Recommended NDK is 25c (the x86_64 version)<br />
<br />
Once downloaded, copy the contents of the NDK to your home or C: folder, rename the folder that you copied to 'android-ndk', for example you will end up with 'c:\android-ndk' and below that folders that say build, meta, platforms, etc.<br />
<br />
==== 1.4.2 Install Ant (no longer required but kept util someone confirms this)====<br />
https://ant.apache.org/<br />
<br />
Once downloaded, copy the contents of the install archive/zip file to your home folder or C: drive.<br />
Eg: so you have a folder called c:\apache-ant-1.10.5 with bin, etc, lib, manual folders within that.<br />
<br />
==== 1.4.3 Mix Old and New Tools (no longer required but kept util someone confirms this) ====<br />
<br />
Gideros uses Ant to build the player, unfortunately the tools to support Ant are now missing from the latest Android tools.<br />
<br />
<br />
There is a fix for this:<br />
<br />
# Rename the existing 'tools' folder in the Android SDK folder to 'tools_new'.<br />
# Download an older (March 2016) version of the tools and copy that folder to the Android SDK folder.<br />
# Copy the contents of 'tools_new' over the contents of 'tools'.<br />
<br />
Here is where you can download the compatible set of tools from:<br />
<br />
(PC) https://dl.google.com/android/repository/tools_r25.2.5-windows.zip<br />
<br />
(MAC) https://dl.google.com/android/repository/tools_r25.2.5-macosx.zip<br />
<br />
(LINUX) https://dl.google.com/android/repository/tools_r25.2.5-linux.zip<br />
<br />
------<br />
<br />
=== 1.5 Install Java ===<br />
You need the Java JDK<br />
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html<br />
<br />
------<br />
<br />
=== 1.6 (PC) Install Visual Studio ===<br />
https://www.visualstudio.com/downloads/<br />
<br />
Install [https://developer.microsoft.com/en-us/windows/downloads/windows-8-1-sdk Win 8.1 SDK]<br />
<br />
Install [https://marketplace.visualstudio.com/items?itemName=AdMediator.MicrosoftAdvertisingSDKforWindowsandWindowsPhone8x Microsoft Advertising SDK for Windows and Windows Phone 8.x]<br />
<br />
Ensure that you have MSBuild v12 or v14 installed (building with the makefile will fail with an incorrect version).<br />
<br />
------<br />
<br />
=== 1.7 (MAC) Install Xcode ===<br />
https://itunes.apple.com/fr/app/xcode/id497799835?mt=12<br />
<br />
------<br />
<br />
=== 1.8 (Mac) ensure xcode command line tools are working ===<br />
(MAC) Open a terminal window <br />
<syntaxhighlight lang="bash"><br />
sudo xCodebuild -license <br />
quit<br />
agree<br />
</syntaxhighlight><br />
<br /><br />
------<br />
<br />
=== 1.9 Install Python ===<br />
https://www.python.org/downloads/release/python-2712/<br />
<br />
You need Python 2.7.12 or later to install emscripten properly.<br />
<br />
Once installed, add it to your command line path, eg: c:\python27, on windows you can do this by right-clicking on 'myComputer' or 'This PC', go to 'Properties', click 'Advanced System Settings', Click 'Environmental Variables', double-click 'Path', add 'c:\python27'.<br />
<br />
------<br />
<br />
=== 1.10 Install emscripten ===<br />
http://kripken.github.io/emscripten-site/<br />
<br />
You need this is you want to build for HTML5 + Facebook games.<br />
<br />
Using a shell or MSYS2 (previously installed) on windows, go to your home or C: folder and type:<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/juj/emsdk.git<br />
</syntaxhighlight><br />
<br />
Once that has completed open a command prompt in that folder on Windows, on other system just cd to the folder.<br />
<br />
Using emsdk, install and activate all the latest packages:<br />
<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install latest<br />
emsdk activate latest<br />
</syntaxhighlight><br />
<br />
(PC) Type:<br />
<syntaxhighlight lang="bash"><br />
emsdk_env.bat<br />
</syntaxhighlight><br />
<br />
(MAC) Type:<br />
<syntaxhighlight lang="bash"><br />
source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
To use incoming branch of emscripten, use these commands instead:<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install sdk-incoming-64bit<br />
emsdk activate sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
To further use Gideros own git fork of emscripten:<br />
<syntaxhighlight lang="bash"><br />
cd emscripten/incoming<br />
# Add a git remote link to your own repository.<br />
git remote add gideros https://github.com/gideros/emscripten.git<br />
# Obtain the changes in your link.<br />
git fetch gideros<br />
# Switch the emscripten-incoming tool to use your fork.<br />
git checkout -b gideros_incoming --track gideros/incoming<br />
#Get back to emscripten directory and rebuild<br />
cd ../..<br />
emsdk install sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
<br />
These can also be installed within emsdk: git, crunch, and spidermonkey<br />
<syntaxhighlight lang="bash"><br />
(on non-PC put ./ before emsdk)<br />
emsdk install git-1.9.4<br />
emsdk install crunch-1.03<br />
emsdk install spidermonkey-37.0.1-64bit<br />
emsdk activate git-1.9.4<br />
emsdk activate crunch-1.03<br />
emsdk activate spidermonkey-37.0.1-64bit<br />
(PC) emsdk_env.bat<br />
(MAC) source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
(PC) Make sure the environment variable EM_CONFIG is set to the location of your emscripten config file.<br />
<br />
The emscripten build also needs the CMake command. You can download it and extract it to your home or C: folder. Don't forget to add it's path to the end of the EMSDKPATH in Makefile.def.<br />
<br />
https://cmake.org/download/<br />
<br />
------<br />
<br />
=== 1.11 Install Steam SDK ===<br />
https://partner.steamgames.com/?goto=%2Fdownloads%2Fsteamworks_sdk.zip<br />
<br />
Extract the archive/zip file to your home or C: folder, for example if the file is called 'steamworks_sdk_142.zip' then you will have a 'c:\steamworks_sdk_142' folder with a solder called 'sdk' within it. The sdk folder contains other folders such as glmgr, public, tools, etc.<br />
<br />
This is necessary for the Steam plugin.<br />
<br />
------<br />
<br />
=== 1.12 Install Gideros ===<br />
<br />
==== 1.12.1 Fetch gideros source code ====<br />
(PC) Open MSYS2 32 bit shell<br />
<br />
(MAC/Linux) Open a terminal<br />
<br />
Navigate to the folder where you into to work.<br />
<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/gideros/gideros <br />
</syntaxhighlight><br />
<br />
==== 1.12.2 Configure scripts ====<br />
Make a copy of the file gideros/scripts/Makefile.def.example, rename it to Makefile.def and update the file copy according <br />
to your installation. Ensure that the QT\_ARCH and QT_TOOLSARCH paths are formatted correctly according to your Qt <br />
install directory structure (see below that they are named differently by Qt).<br />
<br />
''''''Example:''''''<br />
<br/><br />
'''On PC:'''<br />
<br />
For Qt:<syntaxhighlight lang="bash>QTBASEDIR=/c/Qt<br />
QT_ARCH=mingw53_32<br />
QT_TOOLSARCH=mingw530_32<br />
QTVER=5.9.1<br />
QT5ICUVER=59<br />
<br />
STEAMSDK=/c/Applications/steamworks_sdk_142<br />
export STEAMSDK<br />
</syntaxhighlight><br />
<br/><br />
For Android:<br />
<br />
<syntaxhighlight lang="bash"><br />
# on Windows, also add this to PATH<br />
NDK_HOME=/c/android/android-ndk-r17b<br />
NDKBUILD=cmd //c /c/android/android-ndk-r17b/ndk-build.cmd<br />
#We use windows syntax for this one, as it will be used by gradle.bat script<br />
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144<br />
#Windows syntax with quadruple backslashs!<br />
ANDROID_HOME=C:\\\\Users\\\\Gideros\\\\AppData\\\\Local\\\\Android\\\\sdk<br />
<br />
</syntaxhighlight><br />
<br/><br />
For WinRT:<br />
<br />
<syntaxhighlight lang="bash"><br />
FXC="/c/Program Files (x86)/Windows Kits/8.1/bin/x86/fxc.exe" <br />
MSBUILD="/c/Program Files (x86)/MSBuild/14.0/Bin/MSbuild.exe" <br />
</syntaxhighlight><br />
<br/><br />
<br />
For html5:<br />
<br />
<syntaxhighlight lang="bash"><br />
EMSDK=/c/emsdkwin<br />
EMSDKPATH=$(EMSDK):$(EMSDK)/clang/e1.35.0_64bit:$(EMSDK)/node/4.1.1_64bit/bin:$(EMSDK)/python/2.7.5.3_64bit:$(EMSDK)/emscripten/1.35.0<br />
EMSDK_PREFIX=PATH=$(EMSDKPATH):$$$$PATH cmd //c<br />
CRUNCHME=crunchme-win32.exe<br />
</syntaxhighlight><br />
<br/><br />
'''On MAC:''' <br />
<br />
<syntaxhighlight lang="bash"><br />
QTBASEDIR=~/Qt QT_ARCH=clang_64 <br />
QT_TOOLSARCH=clang_64 <br />
QTVER=5.8 <br />
QT5ICUVER=54 #deprecated stuff <br />
</syntaxhighlight><br />
<br />
'''On Linux:''' <br />
(tested on Debian 11)<br />
<syntaxhighlight lang="bash"><br />
QT=/usr<br />
QMAKE=qmake6<br />
QTLIBS=/lib/x86_64-linux-gnu<br />
QTPLUGINS=$(QTLIBS)/qt6/plugins<br />
</syntaxhighlight><br />
<br />
==== 1.12.3 Complete working example Makefile.def for Windows ====<br />
<br />
Here is a working example, you will have to change the filename details to match your setup:<br />
<br />
[[Example Makefile.def file|example Makefile.def file]].<br />
<br />
==== 1.12.4 Fetch additional repositories ====<br />
<br />
Go into just cloned gideros source folder and run make prep.repo<br />
<syntaxhighlight lang="bash"><br />
cd gideros<br />
make -f scripts/Makefile.gid prep.repo <br />
</syntaxhighlight><br />
<br />
If you intend to build the studio, you'll need scintilla and Lexilla libraries. Compile them now with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid qlexilla<br />
make -f scripts/Makefile.gid qscintilla<br />
</syntaxhighlight><br />
<br />
------<br />
<br />
== 2. Building ==<br />
<br />
If you have all dependencies in place for all targets, you can build everything at once via MSYS2 or Terminal with:<br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid<br />
</pre><br />
<br />
=== 2.1 Compilation on PC :===<br />
<br />
Open MSYS2 shell (msys2_shell.cmd). Standard compilation is 32 bit so use a 32 bit shell. Make sure you have installed the necessary build tools in MSYS2 using pacman, as detailed in [[#1.2 (PC) Install MSYS2 Console|Install MSYS2 Console]].<br />
.<br />
<br />
Navigate to gideros folder <br />
<br />
==== 2.1.1 Build QT tools : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid qtapp.install<br />
</pre><br />
<br />
-> files GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in Build.Win folder <br />
<br />
==== 2.1.2 Android: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid android.install <br />
</pre><br />
<br />
= file GiderosAndroidPlayer.apk in folder Build.Win/Players <br />
<br />
==== 2.1.3 winRT: ====<br />
<br />
''If necessary :''<br />
Open the solution, gideros/winRT_example/giderosgame.sln in Visual Studio. Check that the SQLite version for Windows and Windows Phone is up to date. Save and close the solution. <br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid winrt.install <br />
</pre><br />
<br />
= file _bundle.appxupload in folder Build.Win/Players/WinRT<br />
<br />
==== 2.1.4 win32: ====<br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid win32.install <br />
</pre><br />
<br />
= files in folder Build.Win/Templates/win32 <br />
<br />
==== 2.1.5 Html5: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid html5.install<br />
</pre><br />
<br />
-> files in folders Build.Win//Players/Html5 and Build.Win/Templates/Html5<br />
<br />
==== 2.1.6 Plugins: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid bundle.win <br />
</pre><br />
<br />
= folder bin and file gplugin in folder Build.Win/All Plugins<br />
<br />
==== 2.1.7 To build everything that can be built on Windows ====<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid all<br />
</syntaxhighlight><br />
<br />
Then you need to copy all the plugins to the 'Build.Win' folder with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid bundle.win<br />
</syntaxhighlight><br />
<br />
=== 2.2 Compilation on Mac :===<br />
Open Terminal. <br />
<br />
cd to the folder « gideros » <br />
<br />
==== 2.2.1 QT : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid qtapp.install <br />
</pre><br />
<br />
= GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in folder Build.Mac <br />
<br />
==== 2.2.2 iOS : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid ios.install <br />
</pre><br />
<br />
= GiderosiOSPlayer.zip in folder Buid.Mac/Players <br />
<br />
==== 2.2.3 Plugins: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid bundle.mac <br />
</pre><br />
<br />
= folders bin and files gplugin in folder Buid.Mac/All Plugins<br />
<br />
------<br />
<br />
== 3. Cleaning ==<br />
<br />
If you want to reset the build process and start again then you can issue a 'clean' command. To do this type 'make -f scripts/Makefile.gid clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid clean<br />
</syntaxhighlight><br />
<br />
<br />
Sometimes you need to make a clean a particular build. To do this type 'make -f scripts/Makefile.gid ' followed by something like 'html5' then '.clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid html5.clean<br />
</syntaxhighlight></div>Hgy29https://wiki.gideros.rocks/index.php?title=Compiling_Gideros_Source&diff=22485Compiling Gideros Source2023-08-21T07:48:16Z<p>Hgy29: /* 1.3.1 (Linux/Debian) Install Git, build-tools */</p>
<hr />
<div>The following instructions are for developers who want to contribute to or otherwise experiment with the Gideros C/C++ engine and are ''not'' necessary for either building or deploying apps made with Gideros.<br />
<br />
The Gideros project consists of the Gideros Studio IDE, the Gideros SDK libraries, Gideros Texture Packer, Gideros Font Creator, "players" or export templates for all the platforms Gideros supports, all targets of all plugins, a daemon and a bridge. The build system is flexible, so you only need the tools for the targets you are interested in deploying to with Qt (and MSYS2 on Windows) being a realistic minimum.<br />
<br />
<div class="noautonum">__TOC__</div><br />
<br />
== 1. Requirements ==<br />
=== 1.1 Install QT ===<br />
https://www.qt.io/download-open-source/<br />
<br />
Recommended version 6.3 with MinGW <br /><br />
<br />
Double click on the downloaded file and follow instructions. When installing, expand the tree view and ensure you have ticked the MinGW child option of the Qt version checkbox, as well as the MinGW option in the Tools section.<br />
Beside main QT package, you'll need the following additional components:<br />
* WebSocket additional library<br />
* Multimedia additional library<br />
* Qt5 Compatibility addon<br />
<br />
(MAC) Move the created folder into your user account folder <br />
<br />
(LINUX) <br />
On Debian 11:<br />
echo "deb http://deb.debian.org/debian bullseye-backports main" >>/etc/apt/sources.list<br />
apt update<br />
apt install qt6-base-dev qt6-websockets-dev qt6-multimedia-dev qt6-5compat-dev<br />
<br />
Depending on your distribution, you may need to install qt5 websocket lib seperately (sudo apt-get install libqt5websockets5-dev)<br />
<br />
------<br />
<br />
===1.2 (PC) Install MSYS2 Console===<br />
https://msys2.github.io/ <br />
<br />
Double click on the downloaded file (msys2-i686) and follow instructions. <br />
<br />
Open 32 bit MSYS2 shell: msys2_shell.cmd<br />
<syntaxhighlight lang="bash"><br />
pacman -Sy pacman<br />
pacman -Syu<br />
pacman -Su<br />
pacman -S tar<br />
pacman -S zip<br />
pacman -S unzip<br />
pacman -S git<br />
pacman -S base-devel<br />
pacman -S python<br />
#For compiling win32/32bit under a MinGW64<br />
pacman -S mingw-w64-i686-toolchain<br />
pacman -S mingw-w64-i686-glew<br />
pacman -S mingw-w64-i686-curl<br />
pacman -S mingw-w64-i686-libpng<br />
#For compiling win32/64bit under a MinGW64<br />
pacman -S mingw-w64-x86_64-toolchain<br />
pacman -S mingw-w64-x86_64-glew<br />
pacman -S mingw-w64-x86_64-curl<br />
pacman -S mingw-w64-x86_64-libpng<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.3 (Mac) Install Git & xcpretty ===<br />
http://git-scm.com/downloads<br />
<br />
Ctrl + right click, open with « Install program.app » Follow instructions keeping default values as they are. <br />
<br />
(MAC) open a terminal window <br />
<syntaxhighlight lang="bash"><br />
git config -global user.name "your git login" <br />
git config -global user.email "your git email"<br />
sudo gem install xcpretty<br />
</syntaxhighlight><br />
------<br />
=== 1.3.1 (Linux/Debian) Install Git, build-tools ===<br />
<syntaxhighlight lang="bash"><br />
apt install git build-essential libxcb-xinerama0 libgl1-mesa-dev libz-dev libasound2-dev libglew-dev libglfw3-dev<br />
git config --global user.email "your git email"<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.4 (PC) Android requirements ===<br />
<br />
==== 1.4.1 Install Android Studio and NDK ====<br />
<br />
https://developer.android.com/studio/index.html<br />
https://developer.android.com/ndk/downloads/older_releases.html<br />
<br />
Recommended NDK is 25c (the x86_64 version)<br />
<br />
Once downloaded, copy the contents of the NDK to your home or C: folder, rename the folder that you copied to 'android-ndk', for example you will end up with 'c:\android-ndk' and below that folders that say build, meta, platforms, etc.<br />
<br />
==== 1.4.2 Install Ant (no longer required but kept util someone confirms this)====<br />
https://ant.apache.org/<br />
<br />
Once downloaded, copy the contents of the install archive/zip file to your home folder or C: drive.<br />
Eg: so you have a folder called c:\apache-ant-1.10.5 with bin, etc, lib, manual folders within that.<br />
<br />
==== 1.4.3 Mix Old and New Tools (no longer required but kept util someone confirms this) ====<br />
<br />
Gideros uses Ant to build the player, unfortunately the tools to support Ant are now missing from the latest Android tools.<br />
<br />
<br />
There is a fix for this:<br />
<br />
# Rename the existing 'tools' folder in the Android SDK folder to 'tools_new'.<br />
# Download an older (March 2016) version of the tools and copy that folder to the Android SDK folder.<br />
# Copy the contents of 'tools_new' over the contents of 'tools'.<br />
<br />
Here is where you can download the compatible set of tools from:<br />
<br />
(PC) https://dl.google.com/android/repository/tools_r25.2.5-windows.zip<br />
<br />
(MAC) https://dl.google.com/android/repository/tools_r25.2.5-macosx.zip<br />
<br />
(LINUX) https://dl.google.com/android/repository/tools_r25.2.5-linux.zip<br />
<br />
------<br />
<br />
=== 1.5 Install Java ===<br />
You need the Java JDK<br />
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html<br />
<br />
------<br />
<br />
=== 1.6 (PC) Install Visual Studio ===<br />
https://www.visualstudio.com/downloads/<br />
<br />
Install [https://developer.microsoft.com/en-us/windows/downloads/windows-8-1-sdk Win 8.1 SDK]<br />
<br />
Install [https://marketplace.visualstudio.com/items?itemName=AdMediator.MicrosoftAdvertisingSDKforWindowsandWindowsPhone8x Microsoft Advertising SDK for Windows and Windows Phone 8.x]<br />
<br />
Ensure that you have MSBuild v12 or v14 installed (building with the makefile will fail with an incorrect version).<br />
<br />
------<br />
<br />
=== 1.7 (MAC) Install Xcode ===<br />
https://itunes.apple.com/fr/app/xcode/id497799835?mt=12<br />
<br />
------<br />
<br />
=== 1.8 (Mac) ensure xcode command line tools are working ===<br />
(MAC) Open a terminal window <br />
<syntaxhighlight lang="bash"><br />
sudo xCodebuild -license <br />
quit<br />
agree<br />
</syntaxhighlight><br />
<br /><br />
------<br />
<br />
=== 1.9 Install Python ===<br />
https://www.python.org/downloads/release/python-2712/<br />
<br />
You need Python 2.7.12 or later to install emscripten properly.<br />
<br />
Once installed, add it to your command line path, eg: c:\python27, on windows you can do this by right-clicking on 'myComputer' or 'This PC', go to 'Properties', click 'Advanced System Settings', Click 'Environmental Variables', double-click 'Path', add 'c:\python27'.<br />
<br />
------<br />
<br />
=== 1.10 Install emscripten ===<br />
http://kripken.github.io/emscripten-site/<br />
<br />
You need this is you want to build for HTML5 + Facebook games.<br />
<br />
Using a shell or MSYS2 (previously installed) on windows, go to your home or C: folder and type:<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/juj/emsdk.git<br />
</syntaxhighlight><br />
<br />
Once that has completed open a command prompt in that folder on Windows, on other system just cd to the folder.<br />
<br />
Using emsdk, install and activate all the latest packages:<br />
<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install latest<br />
emsdk activate latest<br />
</syntaxhighlight><br />
<br />
(PC) Type:<br />
<syntaxhighlight lang="bash"><br />
emsdk_env.bat<br />
</syntaxhighlight><br />
<br />
(MAC) Type:<br />
<syntaxhighlight lang="bash"><br />
source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
To use incoming branch of emscripten, use these commands instead:<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install sdk-incoming-64bit<br />
emsdk activate sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
To further use Gideros own git fork of emscripten:<br />
<syntaxhighlight lang="bash"><br />
cd emscripten/incoming<br />
# Add a git remote link to your own repository.<br />
git remote add gideros https://github.com/gideros/emscripten.git<br />
# Obtain the changes in your link.<br />
git fetch gideros<br />
# Switch the emscripten-incoming tool to use your fork.<br />
git checkout -b gideros_incoming --track gideros/incoming<br />
#Get back to emscripten directory and rebuild<br />
cd ../..<br />
emsdk install sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
<br />
These can also be installed within emsdk: git, crunch, and spidermonkey<br />
<syntaxhighlight lang="bash"><br />
(on non-PC put ./ before emsdk)<br />
emsdk install git-1.9.4<br />
emsdk install crunch-1.03<br />
emsdk install spidermonkey-37.0.1-64bit<br />
emsdk activate git-1.9.4<br />
emsdk activate crunch-1.03<br />
emsdk activate spidermonkey-37.0.1-64bit<br />
(PC) emsdk_env.bat<br />
(MAC) source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
(PC) Make sure the environment variable EM_CONFIG is set to the location of your emscripten config file.<br />
<br />
The emscripten build also needs the CMake command. You can download it and extract it to your home or C: folder. Don't forget to add it's path to the end of the EMSDKPATH in Makefile.def.<br />
<br />
https://cmake.org/download/<br />
<br />
------<br />
<br />
=== 1.11 Install Steam SDK ===<br />
https://partner.steamgames.com/?goto=%2Fdownloads%2Fsteamworks_sdk.zip<br />
<br />
Extract the archive/zip file to your home or C: folder, for example if the file is called 'steamworks_sdk_142.zip' then you will have a 'c:\steamworks_sdk_142' folder with a solder called 'sdk' within it. The sdk folder contains other folders such as glmgr, public, tools, etc.<br />
<br />
This is necessary for the Steam plugin.<br />
<br />
------<br />
<br />
=== 1.12 Install Gideros ===<br />
<br />
==== 1.12.1 Fetch gideros source code ====<br />
(PC) Open MSYS2 32 bit shell<br />
<br />
(MAC/Linux) Open a terminal<br />
<br />
Navigate to the folder where you into to work.<br />
<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/gideros/gideros <br />
</syntaxhighlight><br />
<br />
==== 1.12.2 Configure scripts ====<br />
Make a copy of the file gideros/scripts/Makefile.def.example, rename it to Makefile.def and update the file copy according <br />
to your installation. Ensure that the QT\_ARCH and QT_TOOLSARCH paths are formatted correctly according to your Qt <br />
install directory structure (see below that they are named differently by Qt).<br />
<br />
''''''Example:''''''<br />
<br/><br />
'''On PC:'''<br />
<br />
For Qt:<syntaxhighlight lang="bash>QTBASEDIR=/c/Qt<br />
QT_ARCH=mingw53_32<br />
QT_TOOLSARCH=mingw530_32<br />
QTVER=5.9.1<br />
QT5ICUVER=59<br />
<br />
STEAMSDK=/c/Applications/steamworks_sdk_142<br />
export STEAMSDK<br />
</syntaxhighlight><br />
<br/><br />
For Android:<br />
<br />
<syntaxhighlight lang="bash"><br />
# on Windows, also add this to PATH<br />
NDK_HOME=/c/android/android-ndk-r17b<br />
NDKBUILD=cmd //c /c/android/android-ndk-r17b/ndk-build.cmd<br />
#We use windows syntax for this one, as it will be used by gradle.bat script<br />
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144<br />
#Windows syntax with quadruple backslashs!<br />
ANDROID_HOME=C:\\\\Users\\\\Gideros\\\\AppData\\\\Local\\\\Android\\\\sdk<br />
<br />
</syntaxhighlight><br />
<br/><br />
For WinRT:<br />
<br />
<syntaxhighlight lang="bash"><br />
FXC="/c/Program Files (x86)/Windows Kits/8.1/bin/x86/fxc.exe" <br />
MSBUILD="/c/Program Files (x86)/MSBuild/14.0/Bin/MSbuild.exe" <br />
</syntaxhighlight><br />
<br/><br />
<br />
For html5:<br />
<br />
<syntaxhighlight lang="bash"><br />
EMSDK=/c/emsdkwin<br />
EMSDKPATH=$(EMSDK):$(EMSDK)/clang/e1.35.0_64bit:$(EMSDK)/node/4.1.1_64bit/bin:$(EMSDK)/python/2.7.5.3_64bit:$(EMSDK)/emscripten/1.35.0<br />
EMSDK_PREFIX=PATH=$(EMSDKPATH):$$$$PATH cmd //c<br />
CRUNCHME=crunchme-win32.exe<br />
</syntaxhighlight><br />
<br/><br />
'''On MAC:''' <br />
<br />
<syntaxhighlight lang="bash"><br />
QTBASEDIR=~/Qt QT_ARCH=clang_64 <br />
QT_TOOLSARCH=clang_64 <br />
QTVER=5.8 <br />
QT5ICUVER=54 #deprecated stuff <br />
</syntaxhighlight><br />
<br />
'''On Linux:''' <br />
(tested on Debian 11)<br />
<syntaxhighlight lang="bash"><br />
QT=/usr<br />
QMAKE=qmake6<br />
QTLIBS=/lib/x86_64-linux-gnu<br />
QTPLUGINS=$(QTLIBS)/qt6/plugins<br />
</syntaxhighlight><br />
<br />
==== 1.12.3 Complete working example Makefile.def for Windows ====<br />
<br />
Here is a working example, you will have to change the filename details to match your setup:<br />
<br />
[[Example Makefile.def file|example Makefile.def file]].<br />
<br />
==== 1.12.4 Fetch additional repositories ====<br />
<br />
Go into just cloned gideros source folder and run make prep.repo<br />
<syntaxhighlight lang="bash"><br />
cd gideros<br />
make -f scripts/Makefile.gid prep.repo <br />
</syntaxhighlight><br />
<br />
If you intend to build the studio, you'll need scintilla and Lexilla libraries. Compile them now with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid qlexilla<br />
make -f scripts/Makefile.gid qscintilla<br />
</syntaxhighlight><br />
<br />
------<br />
<br />
== 2. Building ==<br />
<br />
If you have all dependencies in place for all targets, you can build everything at once via MSYS2 or Terminal with:<br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid<br />
</pre><br />
<br />
=== 2.1 Compilation on PC :===<br />
<br />
Open MSYS2 shell (msys2_shell.cmd). Standard compilation is 32 bit so use a 32 bit shell. Make sure you have installed the necessary build tools in MSYS2 using pacman, as detailed in [[#1.2 (PC) Install MSYS2 Console|Install MSYS2 Console]].<br />
.<br />
<br />
Navigate to gideros folder <br />
<br />
==== 2.1.1 Build QT tools : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid qtapp.install<br />
</pre><br />
<br />
-> files GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in Build.Win folder <br />
<br />
==== 2.1.2 Android: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid android.install <br />
</pre><br />
<br />
= file GiderosAndroidPlayer.apk in folder Build.Win/Players <br />
<br />
==== 2.1.3 winRT: ====<br />
<br />
''If necessary :''<br />
Open the solution, gideros/winRT_example/giderosgame.sln in Visual Studio. Check that the SQLite version for Windows and Windows Phone is up to date. Save and close the solution. <br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid winrt.install <br />
</pre><br />
<br />
= file _bundle.appxupload in folder Build.Win/Players/WinRT<br />
<br />
==== 2.1.4 win32: ====<br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid win32.install <br />
</pre><br />
<br />
= files in folder Build.Win/Templates/win32 <br />
<br />
==== 2.1.5 Html5: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid html5.install<br />
</pre><br />
<br />
-> files in folders Build.Win//Players/Html5 and Build.Win/Templates/Html5<br />
<br />
==== 2.1.6 Plugins: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid bundle.win <br />
</pre><br />
<br />
= folder bin and file gplugin in folder Build.Win/All Plugins<br />
<br />
==== 2.1.7 To build everything that can be built on Windows ====<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid all<br />
</syntaxhighlight><br />
<br />
Then you need to copy all the plugins to the 'Build.Win' folder with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid bundle.win<br />
</syntaxhighlight><br />
<br />
=== 2.2 Compilation on Mac :===<br />
Open Terminal. <br />
<br />
cd to the folder « gideros » <br />
<br />
==== 2.2.1 QT : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid qtapp.install <br />
</pre><br />
<br />
= GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in folder Build.Mac <br />
<br />
==== 2.2.2 iOS : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid ios.install <br />
</pre><br />
<br />
= GiderosiOSPlayer.zip in folder Buid.Mac/Players <br />
<br />
==== 2.2.3 Plugins: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid bundle.mac <br />
</pre><br />
<br />
= folders bin and files gplugin in folder Buid.Mac/All Plugins<br />
<br />
------<br />
<br />
== 3. Cleaning ==<br />
<br />
If you want to reset the build process and start again then you can issue a 'clean' command. To do this type 'make -f scripts/Makefile.gid clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid clean<br />
</syntaxhighlight><br />
<br />
<br />
Sometimes you need to make a clean a particular build. To do this type 'make -f scripts/Makefile.gid ' followed by something like 'html5' then '.clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid html5.clean<br />
</syntaxhighlight></div>Hgy29https://wiki.gideros.rocks/index.php?title=Ads:checkConsent&diff=22484Ads:checkConsent2023-08-18T06:27:52Z<p>Hgy29: </p>
<hr />
<div>__NOTOC__<br />
'''Available since:''' Gideros 2023.8<br/><br />
'''Class:''' [[Ads]]<br/><br />
<br />
=== Description ===<br />
Triggers consent check and flow, if any supported by the Ad engine.<br />
<syntaxhighlight lang="lua"><br />
Ads:checkConsent(parameters)<br />
</syntaxhighlight><br />
<br />
The '''parameters''' table is mandatory and can contain the following fields:<br/><br />
- '''reset''': (boolean) Reset saved consent information, for testing purposes<br/><br />
- '''underAge''': (boolean) Tells if the user is under age as per the Ad engine guidelines<br/><br />
<br />
=== Parameters ===<br />
'''parameters''': (table) consent options<br/><br />
<br />
=== Return values ===<br />
'''Returns''' (boolean) ''true'' if consent flow is supported and if an [[Event.AD_CONSENT]] event will be triggered, ''false'' otherwise.<br />
<br />
{{Ads}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Ads:checkConsent&diff=22483Ads:checkConsent2023-08-18T06:25:35Z<p>Hgy29: /* Description */</p>
<hr />
<div>__NOTOC__<br />
'''Available since:''' Gideros 2023.8<br/><br />
'''Class:''' [[Ads]]<br/><br />
<br />
=== Description ===<br />
Triggers consent check and flow, if any supported by the Ad engine.<br />
<syntaxhighlight lang="lua"><br />
Ads:checkConsent(parameters)<br />
</syntaxhighlight><br />
<br />
The '''parameters''' table is mandatory and can contain the following fields:<br/><br />
- '''reset''': (boolean) Reset saved consent information, for testing purposes<br/><br />
- '''underAge''': (boolean) Tells if the user is under age as per the Ad engine guidelines<br/><br />
<br />
=== Parameters ===<br />
'''parameters''': (table) consent options<br/><br />
<br />
{{Ads}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Ads:checkConsent&diff=22482Ads:checkConsent2023-08-18T06:25:18Z<p>Hgy29: Created page with "__NOTOC__ '''Available since:''' Gideros 2023.8<br/> '''Class:''' Ads<br/> === Description === Triggers consent check and flow, if any supported by the Ad engine. <syntax..."</p>
<hr />
<div>__NOTOC__<br />
'''Available since:''' Gideros 2023.8<br/><br />
'''Class:''' [[Ads]]<br/><br />
<br />
=== Description ===<br />
Triggers consent check and flow, if any supported by the Ad engine.<br />
<syntaxhighlight lang="lua"><br />
Ads:checkConsent(parameters)<br />
</syntaxhighlight><br />
<br />
The '''parameters''' table is mandatory and can contain the following fields:<br />
- '''reset''': (boolean) Reset saved consent information, for testing purposes<br />
- '''underAge''': (boolean) Tells if the user is under age as per the Ad engine guidelines<br />
<br />
=== Parameters ===<br />
'''parameters''': (table) consent options<br/><br />
<br />
{{Ads}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Ads:loadAd&diff=22481Ads:loadAd2023-08-18T06:21:13Z<p>Hgy29: Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> '''Class:''' Ads<br/> === Description === Preloads provided ad type with any other additional information. <syntaxhig..."</p>
<hr />
<div>__NOTOC__<br />
'''Available since:''' Gideros 2011.6<br/><br />
'''Class:''' [[Ads]]<br/><br />
<br />
=== Description ===<br />
Preloads provided ad type with any other additional information.<br />
<syntaxhighlight lang="lua"><br />
Ads:loadAd(adType,...)<br />
</syntaxhighlight><br />
<br />
=== Parameters ===<br />
'''adType''': (string) ad type or format<br/><br />
'''...''': (varies) varies for each ad framework<br/><br />
<br />
{{Ads}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Event.ADS_READY&diff=22480Event.ADS READY2023-08-18T06:18:17Z<p>Hgy29: Created page with "__NOTOC__ '''Available since:''' Gideros 2020<br/> '''Value:''' adsReady<br/> '''Defined by:''' Ads<br/> === Description === Sent when Ad engine is ready to be used. Only..."</p>
<hr />
<div>__NOTOC__<br />
'''Available since:''' Gideros 2020<br/><br />
'''Value:''' adsReady<br/><br />
'''Defined by:''' [[Ads]]<br/><br />
<br />
=== Description ===<br />
Sent when Ad engine is ready to be used. Only some engines send this event.<br />
<br />
{{Ads}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Event.AD_CONSENT&diff=22479Event.AD CONSENT2023-08-18T06:16:28Z<p>Hgy29: Created page with "__NOTOC__ '''Available since:''' Gideros 2023.8<br/> '''Value:''' adConsent<br/> '''Defined by:''' Ads<br/> === Description === Consent flow has finished. === Parameters..."</p>
<hr />
<div>__NOTOC__<br />
'''Available since:''' Gideros 2023.8<br/><br />
'''Value:''' adConsent<br/><br />
'''Defined by:''' [[Ads]]<br/><br />
<br />
=== Description ===<br />
Consent flow has finished.<br />
<br />
=== Parameters ===<br />
'''error''': (string) string describing error if any<br/><br />
'''errorcode''': (number) error code, or 0 if success<br />
<br />
{{Ads}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Ads&diff=22478Ads2023-08-18T06:14:43Z<p>Hgy29: /* Events */</p>
<hr />
<div>__NOTOC__<br />
<!-- GIDEROSOBJ:Ads --><br />
'''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform html5.png]][[File:Platform winrt.png]]<br/><br />
'''Available since:''' Gideros 2011.6<br/><br />
'''Inherits from:''' [[EventDispatcher]]<br/><br />
<br />
=== Description ===<br />
The idea is to provide a common Ads interface for most of available ad frameworks. A common ads interface allows users to switch and fall back between ad frameworks at runtime.<br />
<br />
More information available in [http://docs.giderosmobile.com/interface/ads](Ads interface guide).<br />
<br />
=== Examples ===<br />
'''Admob'''<br />
<syntaxhighlight lang="lua"><br />
Ads = Core.class(Sprite) -- you need to add "Ads" and "Gaming" to your project Plugins<br />
<br />
function Ads:init()<br />
-- ads<br />
self.ADMOB_APP_ID = "ca-app-pub-3940256099942544~3347511713" -- google test id<br />
self.ADMOB_UNIT_ID = "ca-app-pub-3940256099942544/6300978111" -- google test id<br />
<br />
-- admob (setup for simple banner adverts), note: only visible on phone/tablet<br />
if application:getDeviceInfo() == "Android" then<br />
require 'ads' --create real object for on device<br />
self.ADMOB = Ads.new('admob')<br />
self.ADMOB:setKey(self.ADMOB_APP_ID)<br />
self.ADMOB:addEventListener(Event.AD_RECEIVED, function() -- show ad<br />
self.ADMOB:showAd('banner')<br />
self.ADMOB:setAlignment('center', 'bottom')<br />
end)<br />
self.ADMOB:addEventListener(Event.AD_FAILED, function(e) end)<br />
self.ADMOB:addEventListener(Event.AD_ACTION_BEGIN, function() end)<br />
self.ADMOB:addEventListener(Event.AD_ACTION_END, function() end)<br />
self.ADMOB:addEventListener(Event.AD_DISMISSED, function() end)<br />
<br />
self.ADMOB:loadAd("banner", self.ADMOB_UNIT_ID) -- load ad<br />
else<br />
self.ADMOB = {} -- create fake object for testing in windows player<br />
self.ADMOB.loadAd = function() end<br />
self.ADMOB.showAd = function() end<br />
end<br />
<br />
-- LISTENERS<br />
self:addEventListener("enterBegin", self.onTransitionInBegin, self)<br />
self:addEventListener("enterEnd", self.onTransitionInEnd, self)<br />
self:addEventListener("exitBegin", self.onTransitionOutBegin, self)<br />
self:addEventListener("exitEnd", self.onTransitionOutEnd, self)<br />
end<br />
<br />
-- EVENT LISTENERS<br />
function Ads:onTransitionInBegin()<br />
end<br />
function Ads:onTransitionInEnd()<br />
end<br />
function Ads:onTransitionOutBegin()<br />
end<br />
function Ads:onTransitionOutEnd()<br />
end<br />
</syntaxhighlight><br />
<br />
<br />
'''Creating fallbacks with Ads frameworks'''<br />
<syntaxhighlight lang="lua"><br />
--require plugin<br />
require "ads"<br />
<br />
--initialize amazon<br />
amazon = Ads.new("amazon")<br />
amazon:setKey("amazon-key")<br />
<br />
--initialize admob<br />
admob = Ads.new("admob")<br />
admob:setKey("admob-key")<br />
<br />
--if amazon fails<br />
--show admob<br />
amazon:addEventListener(Event.AD_FAILED, function(e)<br />
print("amazon AD_FAILED", e.error)<br />
admob:showAd("auto")<br />
end)<br />
<br />
--if admob fails<br />
--show amazon<br />
admob:addEventListener(Event.AD_FAILED, function(e)<br />
print("admob AD_FAILED", e.error)<br />
amazon:showAd("auto")<br />
end)<br />
<br />
--start displaying amazon ads<br />
amazon:showAd("auto")<br />
</syntaxhighlight><br />
<br />
{|-<br />
| style="width: 50%; vertical-align:top;"|<br />
=== Methods ===<br />
[[Ads.new]] ''initializes new ad framework''<br/><!--GIDEROSMTD:Ads.new(adframework) initializes a new ad framework--><br />
[[Ads:checkConsent]] ''triggers consent flow if needed''<br/><!-- GIDEROSMTD:Ads:checkConsent(parameters) triggers consent flow if need --><br />
[[Ads:enableTesting]] ''enables testing ads''<br/><!--GIDEROSMTD:Ads:enableTesting() enables testing ads--><br />
[[Ads:get]] ''gets property value of the ad''<br/><!--GIDEROSMTD:Ads:get(property) gets the property value of the ad--><br />
[[Ads:getHeight]] ''gets height of the ad''<br/><!--GIDEROSMTD:Ads:getHeight() gets the height of the ad--><br />
[[Ads:getPosition]] ''gets x and y position of the ad''<br/><!--GIDEROSMTD:Ads:getPosition() gets the x and y position of the ad--><br />
[[Ads:getWidth]] ''gets width of the ad''<br/><!--GIDEROSMTD:Ads:getWidth() gets the width of the ad--><br />
[[Ads:getX]] ''gets x position of the ad''<br/><!--GIDEROSMTD:Ads:getX() gets the x position of the ad--><br />
[[Ads:getY]] ''gets y position of the ad''<br/><!--GIDEROSMTD:Ads:getY() gets the y position of the ad--><br />
[[Ads:hideAd]] ''hides the ad''<br/><!-- GIDEROSMTD:Ads:hideAd() hides the ad--><br />
[[Ads:loadAd]] ''loads the ad''<br/><!-- GIDEROSMTD:Ads:loadAd() loads an ad--><br />
[[Ads:set]] ''sets property value of the ad''<br/><!--GIDEROSMTD:Ads:set(property,value) sets the property value of the ad--><br />
[[Ads:setAlignment]] ''sets alignment of the ad''<br/><!--GIDEROSMTD:Ads:setAlignment(horizontal,vertical) sets the alignment of the ad--><br />
[[Ads:setKey]] ''sets keys for the framework''<br/><!--GIDEROSMTD:Ads:setKey(...) sets the keys for the framework--><br />
[[Ads:setPosition]] ''sets position of the ad''<br/><!--GIDEROSMTD:Ads:setPosition(x,y) sets the position of the ad--><br />
[[Ads:setX]] ''sets x position of the ad''<br/><!--GIDEROSMTD:Ads:setX(x) sets the x position of the ad--><br />
[[Ads:setY]] ''sets y position of the ad''<br/><!--GIDEROSMTD:Ads:setY(y) sets the y position of the ad--><br />
[[Ads:showAd]] ''displays the ad''<br/><!--GIDEROSMTD:Ads:showAd(...) displays the ad--><br />
<br />
| style="width: 50%; vertical-align:top;"|<br />
<br />
=== Events ===<br />
[[Event.AD_ACTION_BEGIN]]<br/><!--GIDEROSEVT:Event.AD_ACTION_BEGIN adActionBegin--><br />
[[Event.AD_ACTION_END]]<br/><!--GIDEROSEVT:Event.AD_ACTION_END adActionEnd--><br />
[[Event.AD_CONSENT]]<br/><!--GIDEROSEVT:Event.AD_CONSENTD adConsent--><br />
[[Event.AD_DISMISSED]]<br/><!--GIDEROSEVT:Event.AD_DISMISSED adDismissed--><br />
[[Event.AD_ERROR]]<br/><!--GIDEROSEVT:Event.AD_ERROR adError--><br />
[[Event.AD_FAILED]]<br/><!--GIDEROSEVT:Event.AD_FAILED adFailed--><br />
[[Event.AD_RECEIVED]]<br/><!--GIDEROSEVT:Event.AD_RECEIVED adReceived--><br />
[[Event.AD_REWARDED]]<br/><!--GIDEROSEVT:Event.AD_REWARDED adRewarded--><br />
[[Event.ADS_READY]]<br/><!--GIDEROSEVT:Event.ADS_READY adsReady--><br />
<br />
=== Constants ===<br />
|}<br />
<br />
{{GIDEROS IMPORTANT LINKS}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Ads&diff=22477Ads2023-08-18T06:12:27Z<p>Hgy29: /* Methods */</p>
<hr />
<div>__NOTOC__<br />
<!-- GIDEROSOBJ:Ads --><br />
'''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform html5.png]][[File:Platform winrt.png]]<br/><br />
'''Available since:''' Gideros 2011.6<br/><br />
'''Inherits from:''' [[EventDispatcher]]<br/><br />
<br />
=== Description ===<br />
The idea is to provide a common Ads interface for most of available ad frameworks. A common ads interface allows users to switch and fall back between ad frameworks at runtime.<br />
<br />
More information available in [http://docs.giderosmobile.com/interface/ads](Ads interface guide).<br />
<br />
=== Examples ===<br />
'''Admob'''<br />
<syntaxhighlight lang="lua"><br />
Ads = Core.class(Sprite) -- you need to add "Ads" and "Gaming" to your project Plugins<br />
<br />
function Ads:init()<br />
-- ads<br />
self.ADMOB_APP_ID = "ca-app-pub-3940256099942544~3347511713" -- google test id<br />
self.ADMOB_UNIT_ID = "ca-app-pub-3940256099942544/6300978111" -- google test id<br />
<br />
-- admob (setup for simple banner adverts), note: only visible on phone/tablet<br />
if application:getDeviceInfo() == "Android" then<br />
require 'ads' --create real object for on device<br />
self.ADMOB = Ads.new('admob')<br />
self.ADMOB:setKey(self.ADMOB_APP_ID)<br />
self.ADMOB:addEventListener(Event.AD_RECEIVED, function() -- show ad<br />
self.ADMOB:showAd('banner')<br />
self.ADMOB:setAlignment('center', 'bottom')<br />
end)<br />
self.ADMOB:addEventListener(Event.AD_FAILED, function(e) end)<br />
self.ADMOB:addEventListener(Event.AD_ACTION_BEGIN, function() end)<br />
self.ADMOB:addEventListener(Event.AD_ACTION_END, function() end)<br />
self.ADMOB:addEventListener(Event.AD_DISMISSED, function() end)<br />
<br />
self.ADMOB:loadAd("banner", self.ADMOB_UNIT_ID) -- load ad<br />
else<br />
self.ADMOB = {} -- create fake object for testing in windows player<br />
self.ADMOB.loadAd = function() end<br />
self.ADMOB.showAd = function() end<br />
end<br />
<br />
-- LISTENERS<br />
self:addEventListener("enterBegin", self.onTransitionInBegin, self)<br />
self:addEventListener("enterEnd", self.onTransitionInEnd, self)<br />
self:addEventListener("exitBegin", self.onTransitionOutBegin, self)<br />
self:addEventListener("exitEnd", self.onTransitionOutEnd, self)<br />
end<br />
<br />
-- EVENT LISTENERS<br />
function Ads:onTransitionInBegin()<br />
end<br />
function Ads:onTransitionInEnd()<br />
end<br />
function Ads:onTransitionOutBegin()<br />
end<br />
function Ads:onTransitionOutEnd()<br />
end<br />
</syntaxhighlight><br />
<br />
<br />
'''Creating fallbacks with Ads frameworks'''<br />
<syntaxhighlight lang="lua"><br />
--require plugin<br />
require "ads"<br />
<br />
--initialize amazon<br />
amazon = Ads.new("amazon")<br />
amazon:setKey("amazon-key")<br />
<br />
--initialize admob<br />
admob = Ads.new("admob")<br />
admob:setKey("admob-key")<br />
<br />
--if amazon fails<br />
--show admob<br />
amazon:addEventListener(Event.AD_FAILED, function(e)<br />
print("amazon AD_FAILED", e.error)<br />
admob:showAd("auto")<br />
end)<br />
<br />
--if admob fails<br />
--show amazon<br />
admob:addEventListener(Event.AD_FAILED, function(e)<br />
print("admob AD_FAILED", e.error)<br />
amazon:showAd("auto")<br />
end)<br />
<br />
--start displaying amazon ads<br />
amazon:showAd("auto")<br />
</syntaxhighlight><br />
<br />
{|-<br />
| style="width: 50%; vertical-align:top;"|<br />
=== Methods ===<br />
[[Ads.new]] ''initializes new ad framework''<br/><!--GIDEROSMTD:Ads.new(adframework) initializes a new ad framework--><br />
[[Ads:checkConsent]] ''triggers consent flow if needed''<br/><!-- GIDEROSMTD:Ads:checkConsent(parameters) triggers consent flow if need --><br />
[[Ads:enableTesting]] ''enables testing ads''<br/><!--GIDEROSMTD:Ads:enableTesting() enables testing ads--><br />
[[Ads:get]] ''gets property value of the ad''<br/><!--GIDEROSMTD:Ads:get(property) gets the property value of the ad--><br />
[[Ads:getHeight]] ''gets height of the ad''<br/><!--GIDEROSMTD:Ads:getHeight() gets the height of the ad--><br />
[[Ads:getPosition]] ''gets x and y position of the ad''<br/><!--GIDEROSMTD:Ads:getPosition() gets the x and y position of the ad--><br />
[[Ads:getWidth]] ''gets width of the ad''<br/><!--GIDEROSMTD:Ads:getWidth() gets the width of the ad--><br />
[[Ads:getX]] ''gets x position of the ad''<br/><!--GIDEROSMTD:Ads:getX() gets the x position of the ad--><br />
[[Ads:getY]] ''gets y position of the ad''<br/><!--GIDEROSMTD:Ads:getY() gets the y position of the ad--><br />
[[Ads:hideAd]] ''hides the ad''<br/><!-- GIDEROSMTD:Ads:hideAd() hides the ad--><br />
[[Ads:loadAd]] ''loads the ad''<br/><!-- GIDEROSMTD:Ads:loadAd() loads an ad--><br />
[[Ads:set]] ''sets property value of the ad''<br/><!--GIDEROSMTD:Ads:set(property,value) sets the property value of the ad--><br />
[[Ads:setAlignment]] ''sets alignment of the ad''<br/><!--GIDEROSMTD:Ads:setAlignment(horizontal,vertical) sets the alignment of the ad--><br />
[[Ads:setKey]] ''sets keys for the framework''<br/><!--GIDEROSMTD:Ads:setKey(...) sets the keys for the framework--><br />
[[Ads:setPosition]] ''sets position of the ad''<br/><!--GIDEROSMTD:Ads:setPosition(x,y) sets the position of the ad--><br />
[[Ads:setX]] ''sets x position of the ad''<br/><!--GIDEROSMTD:Ads:setX(x) sets the x position of the ad--><br />
[[Ads:setY]] ''sets y position of the ad''<br/><!--GIDEROSMTD:Ads:setY(y) sets the y position of the ad--><br />
[[Ads:showAd]] ''displays the ad''<br/><!--GIDEROSMTD:Ads:showAd(...) displays the ad--><br />
<br />
| style="width: 50%; vertical-align:top;"|<br />
<br />
=== Events ===<br />
[[Event.AD_ACTION_BEGIN]]<br/><!--GIDEROSEVT:Event.AD_ACTION_BEGIN adActionBegin--><br />
[[Event.AD_ACTION_END]]<br/><!--GIDEROSEVT:Event.AD_ACTION_END adActionEnd--><br />
[[Event.AD_DISMISSED]]<br/><!--GIDEROSEVT:Event.AD_DISMISSED adDismissed--><br />
[[Event.AD_ERROR]]<br/><!--GIDEROSEVT:Event.AD_ERROR adError--><br />
[[Event.AD_FAILED]]<br/><!--GIDEROSEVT:Event.AD_FAILED adFailed--><br />
[[Event.AD_RECEIVED]]<br/><!--GIDEROSEVT:Event.AD_RECEIVED adReceived--><br />
[[Event.AD_REWARDED]]<br/><!--GIDEROSEVT:Event.AD_RECEIVED adReceived--><br />
<br />
=== Constants ===<br />
|}<br />
<br />
{{GIDEROS IMPORTANT LINKS}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Compiling_Gideros_Source&diff=22476Compiling Gideros Source2023-08-18T06:09:41Z<p>Hgy29: /* 1.4.1 Install Android Studio and NDK */</p>
<hr />
<div>The following instructions are for developers who want to contribute to or otherwise experiment with the Gideros C/C++ engine and are ''not'' necessary for either building or deploying apps made with Gideros.<br />
<br />
The Gideros project consists of the Gideros Studio IDE, the Gideros SDK libraries, Gideros Texture Packer, Gideros Font Creator, "players" or export templates for all the platforms Gideros supports, all targets of all plugins, a daemon and a bridge. The build system is flexible, so you only need the tools for the targets you are interested in deploying to with Qt (and MSYS2 on Windows) being a realistic minimum.<br />
<br />
<div class="noautonum">__TOC__</div><br />
<br />
== 1. Requirements ==<br />
=== 1.1 Install QT ===<br />
https://www.qt.io/download-open-source/<br />
<br />
Recommended version 6.3 with MinGW <br /><br />
<br />
Double click on the downloaded file and follow instructions. When installing, expand the tree view and ensure you have ticked the MinGW child option of the Qt version checkbox, as well as the MinGW option in the Tools section.<br />
Beside main QT package, you'll need the following additional components:<br />
* WebSocket additional library<br />
* Multimedia additional library<br />
* Qt5 Compatibility addon<br />
<br />
(MAC) Move the created folder into your user account folder <br />
<br />
(LINUX) <br />
On Debian 11:<br />
echo "deb http://deb.debian.org/debian bullseye-backports main" >>/etc/apt/sources.list<br />
apt update<br />
apt install qt6-base-dev qt6-websockets-dev qt6-multimedia-dev qt6-5compat-dev<br />
<br />
Depending on your distribution, you may need to install qt5 websocket lib seperately (sudo apt-get install libqt5websockets5-dev)<br />
<br />
------<br />
<br />
===1.2 (PC) Install MSYS2 Console===<br />
https://msys2.github.io/ <br />
<br />
Double click on the downloaded file (msys2-i686) and follow instructions. <br />
<br />
Open 32 bit MSYS2 shell: msys2_shell.cmd<br />
<syntaxhighlight lang="bash"><br />
pacman -Sy pacman<br />
pacman -Syu<br />
pacman -Su<br />
pacman -S tar<br />
pacman -S zip<br />
pacman -S unzip<br />
pacman -S git<br />
pacman -S base-devel<br />
pacman -S python<br />
#For compiling win32/32bit under a MinGW64<br />
pacman -S mingw-w64-i686-toolchain<br />
pacman -S mingw-w64-i686-glew<br />
pacman -S mingw-w64-i686-curl<br />
pacman -S mingw-w64-i686-libpng<br />
#For compiling win32/64bit under a MinGW64<br />
pacman -S mingw-w64-x86_64-toolchain<br />
pacman -S mingw-w64-x86_64-glew<br />
pacman -S mingw-w64-x86_64-curl<br />
pacman -S mingw-w64-x86_64-libpng<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.3 (Mac) Install Git & xcpretty ===<br />
http://git-scm.com/downloads<br />
<br />
Ctrl + right click, open with « Install program.app » Follow instructions keeping default values as they are. <br />
<br />
(MAC) open a terminal window <br />
<syntaxhighlight lang="bash"><br />
git config -global user.name "your git login" <br />
git config -global user.email "your git email"<br />
sudo gem install xcpretty<br />
</syntaxhighlight><br />
------<br />
=== 1.3.1 (Linux/Debian) Install Git, build-tools ===<br />
<syntaxhighlight lang="bash"><br />
apt install git build-essential libxcb-xinerama0 libgl1-mesa-dev libz-dev libasound2-dev<br />
git config --global user.email "your git email"<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.4 (PC) Android requirements ===<br />
<br />
==== 1.4.1 Install Android Studio and NDK ====<br />
<br />
https://developer.android.com/studio/index.html<br />
https://developer.android.com/ndk/downloads/older_releases.html<br />
<br />
Recommended NDK is 25c (the x86_64 version)<br />
<br />
Once downloaded, copy the contents of the NDK to your home or C: folder, rename the folder that you copied to 'android-ndk', for example you will end up with 'c:\android-ndk' and below that folders that say build, meta, platforms, etc.<br />
<br />
==== 1.4.2 Install Ant (no longer required but kept util someone confirms this)====<br />
https://ant.apache.org/<br />
<br />
Once downloaded, copy the contents of the install archive/zip file to your home folder or C: drive.<br />
Eg: so you have a folder called c:\apache-ant-1.10.5 with bin, etc, lib, manual folders within that.<br />
<br />
==== 1.4.3 Mix Old and New Tools (no longer required but kept util someone confirms this) ====<br />
<br />
Gideros uses Ant to build the player, unfortunately the tools to support Ant are now missing from the latest Android tools.<br />
<br />
<br />
There is a fix for this:<br />
<br />
# Rename the existing 'tools' folder in the Android SDK folder to 'tools_new'.<br />
# Download an older (March 2016) version of the tools and copy that folder to the Android SDK folder.<br />
# Copy the contents of 'tools_new' over the contents of 'tools'.<br />
<br />
Here is where you can download the compatible set of tools from:<br />
<br />
(PC) https://dl.google.com/android/repository/tools_r25.2.5-windows.zip<br />
<br />
(MAC) https://dl.google.com/android/repository/tools_r25.2.5-macosx.zip<br />
<br />
(LINUX) https://dl.google.com/android/repository/tools_r25.2.5-linux.zip<br />
<br />
------<br />
<br />
=== 1.5 Install Java ===<br />
You need the Java JDK<br />
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html<br />
<br />
------<br />
<br />
=== 1.6 (PC) Install Visual Studio ===<br />
https://www.visualstudio.com/downloads/<br />
<br />
Install [https://developer.microsoft.com/en-us/windows/downloads/windows-8-1-sdk Win 8.1 SDK]<br />
<br />
Install [https://marketplace.visualstudio.com/items?itemName=AdMediator.MicrosoftAdvertisingSDKforWindowsandWindowsPhone8x Microsoft Advertising SDK for Windows and Windows Phone 8.x]<br />
<br />
Ensure that you have MSBuild v12 or v14 installed (building with the makefile will fail with an incorrect version).<br />
<br />
------<br />
<br />
=== 1.7 (MAC) Install Xcode ===<br />
https://itunes.apple.com/fr/app/xcode/id497799835?mt=12<br />
<br />
------<br />
<br />
=== 1.8 (Mac) ensure xcode command line tools are working ===<br />
(MAC) Open a terminal window <br />
<syntaxhighlight lang="bash"><br />
sudo xCodebuild -license <br />
quit<br />
agree<br />
</syntaxhighlight><br />
<br /><br />
------<br />
<br />
=== 1.9 Install Python ===<br />
https://www.python.org/downloads/release/python-2712/<br />
<br />
You need Python 2.7.12 or later to install emscripten properly.<br />
<br />
Once installed, add it to your command line path, eg: c:\python27, on windows you can do this by right-clicking on 'myComputer' or 'This PC', go to 'Properties', click 'Advanced System Settings', Click 'Environmental Variables', double-click 'Path', add 'c:\python27'.<br />
<br />
------<br />
<br />
=== 1.10 Install emscripten ===<br />
http://kripken.github.io/emscripten-site/<br />
<br />
You need this is you want to build for HTML5 + Facebook games.<br />
<br />
Using a shell or MSYS2 (previously installed) on windows, go to your home or C: folder and type:<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/juj/emsdk.git<br />
</syntaxhighlight><br />
<br />
Once that has completed open a command prompt in that folder on Windows, on other system just cd to the folder.<br />
<br />
Using emsdk, install and activate all the latest packages:<br />
<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install latest<br />
emsdk activate latest<br />
</syntaxhighlight><br />
<br />
(PC) Type:<br />
<syntaxhighlight lang="bash"><br />
emsdk_env.bat<br />
</syntaxhighlight><br />
<br />
(MAC) Type:<br />
<syntaxhighlight lang="bash"><br />
source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
To use incoming branch of emscripten, use these commands instead:<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install sdk-incoming-64bit<br />
emsdk activate sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
To further use Gideros own git fork of emscripten:<br />
<syntaxhighlight lang="bash"><br />
cd emscripten/incoming<br />
# Add a git remote link to your own repository.<br />
git remote add gideros https://github.com/gideros/emscripten.git<br />
# Obtain the changes in your link.<br />
git fetch gideros<br />
# Switch the emscripten-incoming tool to use your fork.<br />
git checkout -b gideros_incoming --track gideros/incoming<br />
#Get back to emscripten directory and rebuild<br />
cd ../..<br />
emsdk install sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
<br />
These can also be installed within emsdk: git, crunch, and spidermonkey<br />
<syntaxhighlight lang="bash"><br />
(on non-PC put ./ before emsdk)<br />
emsdk install git-1.9.4<br />
emsdk install crunch-1.03<br />
emsdk install spidermonkey-37.0.1-64bit<br />
emsdk activate git-1.9.4<br />
emsdk activate crunch-1.03<br />
emsdk activate spidermonkey-37.0.1-64bit<br />
(PC) emsdk_env.bat<br />
(MAC) source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
(PC) Make sure the environment variable EM_CONFIG is set to the location of your emscripten config file.<br />
<br />
The emscripten build also needs the CMake command. You can download it and extract it to your home or C: folder. Don't forget to add it's path to the end of the EMSDKPATH in Makefile.def.<br />
<br />
https://cmake.org/download/<br />
<br />
------<br />
<br />
=== 1.11 Install Steam SDK ===<br />
https://partner.steamgames.com/?goto=%2Fdownloads%2Fsteamworks_sdk.zip<br />
<br />
Extract the archive/zip file to your home or C: folder, for example if the file is called 'steamworks_sdk_142.zip' then you will have a 'c:\steamworks_sdk_142' folder with a solder called 'sdk' within it. The sdk folder contains other folders such as glmgr, public, tools, etc.<br />
<br />
This is necessary for the Steam plugin.<br />
<br />
------<br />
<br />
=== 1.12 Install Gideros ===<br />
<br />
==== 1.12.1 Fetch gideros source code ====<br />
(PC) Open MSYS2 32 bit shell<br />
<br />
(MAC/Linux) Open a terminal<br />
<br />
Navigate to the folder where you into to work.<br />
<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/gideros/gideros <br />
</syntaxhighlight><br />
<br />
==== 1.12.2 Configure scripts ====<br />
Make a copy of the file gideros/scripts/Makefile.def.example, rename it to Makefile.def and update the file copy according <br />
to your installation. Ensure that the QT\_ARCH and QT_TOOLSARCH paths are formatted correctly according to your Qt <br />
install directory structure (see below that they are named differently by Qt).<br />
<br />
''''''Example:''''''<br />
<br/><br />
'''On PC:'''<br />
<br />
For Qt:<syntaxhighlight lang="bash>QTBASEDIR=/c/Qt<br />
QT_ARCH=mingw53_32<br />
QT_TOOLSARCH=mingw530_32<br />
QTVER=5.9.1<br />
QT5ICUVER=59<br />
<br />
STEAMSDK=/c/Applications/steamworks_sdk_142<br />
export STEAMSDK<br />
</syntaxhighlight><br />
<br/><br />
For Android:<br />
<br />
<syntaxhighlight lang="bash"><br />
# on Windows, also add this to PATH<br />
NDK_HOME=/c/android/android-ndk-r17b<br />
NDKBUILD=cmd //c /c/android/android-ndk-r17b/ndk-build.cmd<br />
#We use windows syntax for this one, as it will be used by gradle.bat script<br />
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144<br />
#Windows syntax with quadruple backslashs!<br />
ANDROID_HOME=C:\\\\Users\\\\Gideros\\\\AppData\\\\Local\\\\Android\\\\sdk<br />
<br />
</syntaxhighlight><br />
<br/><br />
For WinRT:<br />
<br />
<syntaxhighlight lang="bash"><br />
FXC="/c/Program Files (x86)/Windows Kits/8.1/bin/x86/fxc.exe" <br />
MSBUILD="/c/Program Files (x86)/MSBuild/14.0/Bin/MSbuild.exe" <br />
</syntaxhighlight><br />
<br/><br />
<br />
For html5:<br />
<br />
<syntaxhighlight lang="bash"><br />
EMSDK=/c/emsdkwin<br />
EMSDKPATH=$(EMSDK):$(EMSDK)/clang/e1.35.0_64bit:$(EMSDK)/node/4.1.1_64bit/bin:$(EMSDK)/python/2.7.5.3_64bit:$(EMSDK)/emscripten/1.35.0<br />
EMSDK_PREFIX=PATH=$(EMSDKPATH):$$$$PATH cmd //c<br />
CRUNCHME=crunchme-win32.exe<br />
</syntaxhighlight><br />
<br/><br />
'''On MAC:''' <br />
<br />
<syntaxhighlight lang="bash"><br />
QTBASEDIR=~/Qt QT_ARCH=clang_64 <br />
QT_TOOLSARCH=clang_64 <br />
QTVER=5.8 <br />
QT5ICUVER=54 #deprecated stuff <br />
</syntaxhighlight><br />
<br />
'''On Linux:''' <br />
(tested on Debian 11)<br />
<syntaxhighlight lang="bash"><br />
QT=/usr<br />
QMAKE=qmake6<br />
QTLIBS=/lib/x86_64-linux-gnu<br />
QTPLUGINS=$(QTLIBS)/qt6/plugins<br />
</syntaxhighlight><br />
<br />
==== 1.12.3 Complete working example Makefile.def for Windows ====<br />
<br />
Here is a working example, you will have to change the filename details to match your setup:<br />
<br />
[[Example Makefile.def file|example Makefile.def file]].<br />
<br />
==== 1.12.4 Fetch additional repositories ====<br />
<br />
Go into just cloned gideros source folder and run make prep.repo<br />
<syntaxhighlight lang="bash"><br />
cd gideros<br />
make -f scripts/Makefile.gid prep.repo <br />
</syntaxhighlight><br />
<br />
If you intend to build the studio, you'll need scintilla and Lexilla libraries. Compile them now with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid qlexilla<br />
make -f scripts/Makefile.gid qscintilla<br />
</syntaxhighlight><br />
<br />
------<br />
<br />
== 2. Building ==<br />
<br />
If you have all dependencies in place for all targets, you can build everything at once via MSYS2 or Terminal with:<br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid<br />
</pre><br />
<br />
=== 2.1 Compilation on PC :===<br />
<br />
Open MSYS2 shell (msys2_shell.cmd). Standard compilation is 32 bit so use a 32 bit shell. Make sure you have installed the necessary build tools in MSYS2 using pacman, as detailed in [[#1.2 (PC) Install MSYS2 Console|Install MSYS2 Console]].<br />
.<br />
<br />
Navigate to gideros folder <br />
<br />
==== 2.1.1 Build QT tools : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid qtapp.install<br />
</pre><br />
<br />
-> files GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in Build.Win folder <br />
<br />
==== 2.1.2 Android: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid android.install <br />
</pre><br />
<br />
= file GiderosAndroidPlayer.apk in folder Build.Win/Players <br />
<br />
==== 2.1.3 winRT: ====<br />
<br />
''If necessary :''<br />
Open the solution, gideros/winRT_example/giderosgame.sln in Visual Studio. Check that the SQLite version for Windows and Windows Phone is up to date. Save and close the solution. <br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid winrt.install <br />
</pre><br />
<br />
= file _bundle.appxupload in folder Build.Win/Players/WinRT<br />
<br />
==== 2.1.4 win32: ====<br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid win32.install <br />
</pre><br />
<br />
= files in folder Build.Win/Templates/win32 <br />
<br />
==== 2.1.5 Html5: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid html5.install<br />
</pre><br />
<br />
-> files in folders Build.Win//Players/Html5 and Build.Win/Templates/Html5<br />
<br />
==== 2.1.6 Plugins: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid bundle.win <br />
</pre><br />
<br />
= folder bin and file gplugin in folder Build.Win/All Plugins<br />
<br />
==== 2.1.7 To build everything that can be built on Windows ====<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid all<br />
</syntaxhighlight><br />
<br />
Then you need to copy all the plugins to the 'Build.Win' folder with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid bundle.win<br />
</syntaxhighlight><br />
<br />
=== 2.2 Compilation on Mac :===<br />
Open Terminal. <br />
<br />
cd to the folder « gideros » <br />
<br />
==== 2.2.1 QT : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid qtapp.install <br />
</pre><br />
<br />
= GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in folder Build.Mac <br />
<br />
==== 2.2.2 iOS : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid ios.install <br />
</pre><br />
<br />
= GiderosiOSPlayer.zip in folder Buid.Mac/Players <br />
<br />
==== 2.2.3 Plugins: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid bundle.mac <br />
</pre><br />
<br />
= folders bin and files gplugin in folder Buid.Mac/All Plugins<br />
<br />
------<br />
<br />
== 3. Cleaning ==<br />
<br />
If you want to reset the build process and start again then you can issue a 'clean' command. To do this type 'make -f scripts/Makefile.gid clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid clean<br />
</syntaxhighlight><br />
<br />
<br />
Sometimes you need to make a clean a particular build. To do this type 'make -f scripts/Makefile.gid ' followed by something like 'html5' then '.clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid html5.clean<br />
</syntaxhighlight></div>Hgy29https://wiki.gideros.rocks/index.php?title=Compiling_Gideros_Source&diff=22475Compiling Gideros Source2023-08-18T05:59:09Z<p>Hgy29: </p>
<hr />
<div>The following instructions are for developers who want to contribute to or otherwise experiment with the Gideros C/C++ engine and are ''not'' necessary for either building or deploying apps made with Gideros.<br />
<br />
The Gideros project consists of the Gideros Studio IDE, the Gideros SDK libraries, Gideros Texture Packer, Gideros Font Creator, "players" or export templates for all the platforms Gideros supports, all targets of all plugins, a daemon and a bridge. The build system is flexible, so you only need the tools for the targets you are interested in deploying to with Qt (and MSYS2 on Windows) being a realistic minimum.<br />
<br />
<div class="noautonum">__TOC__</div><br />
<br />
== 1. Requirements ==<br />
=== 1.1 Install QT ===<br />
https://www.qt.io/download-open-source/<br />
<br />
Recommended version 6.3 with MinGW <br /><br />
<br />
Double click on the downloaded file and follow instructions. When installing, expand the tree view and ensure you have ticked the MinGW child option of the Qt version checkbox, as well as the MinGW option in the Tools section.<br />
Beside main QT package, you'll need the following additional components:<br />
* WebSocket additional library<br />
* Multimedia additional library<br />
* Qt5 Compatibility addon<br />
<br />
(MAC) Move the created folder into your user account folder <br />
<br />
(LINUX) <br />
On Debian 11:<br />
echo "deb http://deb.debian.org/debian bullseye-backports main" >>/etc/apt/sources.list<br />
apt update<br />
apt install qt6-base-dev qt6-websockets-dev qt6-multimedia-dev qt6-5compat-dev<br />
<br />
Depending on your distribution, you may need to install qt5 websocket lib seperately (sudo apt-get install libqt5websockets5-dev)<br />
<br />
------<br />
<br />
===1.2 (PC) Install MSYS2 Console===<br />
https://msys2.github.io/ <br />
<br />
Double click on the downloaded file (msys2-i686) and follow instructions. <br />
<br />
Open 32 bit MSYS2 shell: msys2_shell.cmd<br />
<syntaxhighlight lang="bash"><br />
pacman -Sy pacman<br />
pacman -Syu<br />
pacman -Su<br />
pacman -S tar<br />
pacman -S zip<br />
pacman -S unzip<br />
pacman -S git<br />
pacman -S base-devel<br />
pacman -S python<br />
#For compiling win32/32bit under a MinGW64<br />
pacman -S mingw-w64-i686-toolchain<br />
pacman -S mingw-w64-i686-glew<br />
pacman -S mingw-w64-i686-curl<br />
pacman -S mingw-w64-i686-libpng<br />
#For compiling win32/64bit under a MinGW64<br />
pacman -S mingw-w64-x86_64-toolchain<br />
pacman -S mingw-w64-x86_64-glew<br />
pacman -S mingw-w64-x86_64-curl<br />
pacman -S mingw-w64-x86_64-libpng<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.3 (Mac) Install Git & xcpretty ===<br />
http://git-scm.com/downloads<br />
<br />
Ctrl + right click, open with « Install program.app » Follow instructions keeping default values as they are. <br />
<br />
(MAC) open a terminal window <br />
<syntaxhighlight lang="bash"><br />
git config -global user.name "your git login" <br />
git config -global user.email "your git email"<br />
sudo gem install xcpretty<br />
</syntaxhighlight><br />
------<br />
=== 1.3.1 (Linux/Debian) Install Git, build-tools ===<br />
<syntaxhighlight lang="bash"><br />
apt install git build-essential libxcb-xinerama0 libgl1-mesa-dev libz-dev libasound2-dev<br />
git config --global user.email "your git email"<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.4 (PC) Android requirements ===<br />
<br />
==== 1.4.1 Install Android Studio and NDK ====<br />
<br />
https://developer.android.com/studio/index.html<br />
https://developer.android.com/ndk/downloads/older_releases.html<br />
<br />
Recommended NDK is 17b (the x86_64 version)<br />
<br />
Once downloaded, copy the contents of the NDK to your home or C: folder, rename the folder that you copied to 'android-ndk', for example you will end up with 'c:\android-ndk' and below that folders that say build, meta, platforms, etc.<br />
<br />
==== 1.4.2 Install Ant (no longer required but kept util someone confirms this)====<br />
https://ant.apache.org/<br />
<br />
Once downloaded, copy the contents of the install archive/zip file to your home folder or C: drive.<br />
Eg: so you have a folder called c:\apache-ant-1.10.5 with bin, etc, lib, manual folders within that.<br />
<br />
==== 1.4.3 Mix Old and New Tools (no longer required but kept util someone confirms this) ====<br />
<br />
Gideros uses Ant to build the player, unfortunately the tools to support Ant are now missing from the latest Android tools.<br />
<br />
<br />
There is a fix for this:<br />
<br />
# Rename the existing 'tools' folder in the Android SDK folder to 'tools_new'.<br />
# Download an older (March 2016) version of the tools and copy that folder to the Android SDK folder.<br />
# Copy the contents of 'tools_new' over the contents of 'tools'.<br />
<br />
Here is where you can download the compatible set of tools from:<br />
<br />
(PC) https://dl.google.com/android/repository/tools_r25.2.5-windows.zip<br />
<br />
(MAC) https://dl.google.com/android/repository/tools_r25.2.5-macosx.zip<br />
<br />
(LINUX) https://dl.google.com/android/repository/tools_r25.2.5-linux.zip<br />
<br />
------<br />
<br />
=== 1.5 Install Java ===<br />
You need the Java JDK<br />
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html<br />
<br />
------<br />
<br />
=== 1.6 (PC) Install Visual Studio ===<br />
https://www.visualstudio.com/downloads/<br />
<br />
Install [https://developer.microsoft.com/en-us/windows/downloads/windows-8-1-sdk Win 8.1 SDK]<br />
<br />
Install [https://marketplace.visualstudio.com/items?itemName=AdMediator.MicrosoftAdvertisingSDKforWindowsandWindowsPhone8x Microsoft Advertising SDK for Windows and Windows Phone 8.x]<br />
<br />
Ensure that you have MSBuild v12 or v14 installed (building with the makefile will fail with an incorrect version).<br />
<br />
------<br />
<br />
=== 1.7 (MAC) Install Xcode ===<br />
https://itunes.apple.com/fr/app/xcode/id497799835?mt=12<br />
<br />
------<br />
<br />
=== 1.8 (Mac) ensure xcode command line tools are working ===<br />
(MAC) Open a terminal window <br />
<syntaxhighlight lang="bash"><br />
sudo xCodebuild -license <br />
quit<br />
agree<br />
</syntaxhighlight><br />
<br /><br />
------<br />
<br />
=== 1.9 Install Python ===<br />
https://www.python.org/downloads/release/python-2712/<br />
<br />
You need Python 2.7.12 or later to install emscripten properly.<br />
<br />
Once installed, add it to your command line path, eg: c:\python27, on windows you can do this by right-clicking on 'myComputer' or 'This PC', go to 'Properties', click 'Advanced System Settings', Click 'Environmental Variables', double-click 'Path', add 'c:\python27'.<br />
<br />
------<br />
<br />
=== 1.10 Install emscripten ===<br />
http://kripken.github.io/emscripten-site/<br />
<br />
You need this is you want to build for HTML5 + Facebook games.<br />
<br />
Using a shell or MSYS2 (previously installed) on windows, go to your home or C: folder and type:<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/juj/emsdk.git<br />
</syntaxhighlight><br />
<br />
Once that has completed open a command prompt in that folder on Windows, on other system just cd to the folder.<br />
<br />
Using emsdk, install and activate all the latest packages:<br />
<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install latest<br />
emsdk activate latest<br />
</syntaxhighlight><br />
<br />
(PC) Type:<br />
<syntaxhighlight lang="bash"><br />
emsdk_env.bat<br />
</syntaxhighlight><br />
<br />
(MAC) Type:<br />
<syntaxhighlight lang="bash"><br />
source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
To use incoming branch of emscripten, use these commands instead:<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install sdk-incoming-64bit<br />
emsdk activate sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
To further use Gideros own git fork of emscripten:<br />
<syntaxhighlight lang="bash"><br />
cd emscripten/incoming<br />
# Add a git remote link to your own repository.<br />
git remote add gideros https://github.com/gideros/emscripten.git<br />
# Obtain the changes in your link.<br />
git fetch gideros<br />
# Switch the emscripten-incoming tool to use your fork.<br />
git checkout -b gideros_incoming --track gideros/incoming<br />
#Get back to emscripten directory and rebuild<br />
cd ../..<br />
emsdk install sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
<br />
These can also be installed within emsdk: git, crunch, and spidermonkey<br />
<syntaxhighlight lang="bash"><br />
(on non-PC put ./ before emsdk)<br />
emsdk install git-1.9.4<br />
emsdk install crunch-1.03<br />
emsdk install spidermonkey-37.0.1-64bit<br />
emsdk activate git-1.9.4<br />
emsdk activate crunch-1.03<br />
emsdk activate spidermonkey-37.0.1-64bit<br />
(PC) emsdk_env.bat<br />
(MAC) source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
(PC) Make sure the environment variable EM_CONFIG is set to the location of your emscripten config file.<br />
<br />
The emscripten build also needs the CMake command. You can download it and extract it to your home or C: folder. Don't forget to add it's path to the end of the EMSDKPATH in Makefile.def.<br />
<br />
https://cmake.org/download/<br />
<br />
------<br />
<br />
=== 1.11 Install Steam SDK ===<br />
https://partner.steamgames.com/?goto=%2Fdownloads%2Fsteamworks_sdk.zip<br />
<br />
Extract the archive/zip file to your home or C: folder, for example if the file is called 'steamworks_sdk_142.zip' then you will have a 'c:\steamworks_sdk_142' folder with a solder called 'sdk' within it. The sdk folder contains other folders such as glmgr, public, tools, etc.<br />
<br />
This is necessary for the Steam plugin.<br />
<br />
------<br />
<br />
=== 1.12 Install Gideros ===<br />
<br />
==== 1.12.1 Fetch gideros source code ====<br />
(PC) Open MSYS2 32 bit shell<br />
<br />
(MAC/Linux) Open a terminal<br />
<br />
Navigate to the folder where you into to work.<br />
<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/gideros/gideros <br />
</syntaxhighlight><br />
<br />
==== 1.12.2 Configure scripts ====<br />
Make a copy of the file gideros/scripts/Makefile.def.example, rename it to Makefile.def and update the file copy according <br />
to your installation. Ensure that the QT\_ARCH and QT_TOOLSARCH paths are formatted correctly according to your Qt <br />
install directory structure (see below that they are named differently by Qt).<br />
<br />
''''''Example:''''''<br />
<br/><br />
'''On PC:'''<br />
<br />
For Qt:<syntaxhighlight lang="bash>QTBASEDIR=/c/Qt<br />
QT_ARCH=mingw53_32<br />
QT_TOOLSARCH=mingw530_32<br />
QTVER=5.9.1<br />
QT5ICUVER=59<br />
<br />
STEAMSDK=/c/Applications/steamworks_sdk_142<br />
export STEAMSDK<br />
</syntaxhighlight><br />
<br/><br />
For Android:<br />
<br />
<syntaxhighlight lang="bash"><br />
# on Windows, also add this to PATH<br />
NDK_HOME=/c/android/android-ndk-r17b<br />
NDKBUILD=cmd //c /c/android/android-ndk-r17b/ndk-build.cmd<br />
#We use windows syntax for this one, as it will be used by gradle.bat script<br />
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144<br />
#Windows syntax with quadruple backslashs!<br />
ANDROID_HOME=C:\\\\Users\\\\Gideros\\\\AppData\\\\Local\\\\Android\\\\sdk<br />
<br />
</syntaxhighlight><br />
<br/><br />
For WinRT:<br />
<br />
<syntaxhighlight lang="bash"><br />
FXC="/c/Program Files (x86)/Windows Kits/8.1/bin/x86/fxc.exe" <br />
MSBUILD="/c/Program Files (x86)/MSBuild/14.0/Bin/MSbuild.exe" <br />
</syntaxhighlight><br />
<br/><br />
<br />
For html5:<br />
<br />
<syntaxhighlight lang="bash"><br />
EMSDK=/c/emsdkwin<br />
EMSDKPATH=$(EMSDK):$(EMSDK)/clang/e1.35.0_64bit:$(EMSDK)/node/4.1.1_64bit/bin:$(EMSDK)/python/2.7.5.3_64bit:$(EMSDK)/emscripten/1.35.0<br />
EMSDK_PREFIX=PATH=$(EMSDKPATH):$$$$PATH cmd //c<br />
CRUNCHME=crunchme-win32.exe<br />
</syntaxhighlight><br />
<br/><br />
'''On MAC:''' <br />
<br />
<syntaxhighlight lang="bash"><br />
QTBASEDIR=~/Qt QT_ARCH=clang_64 <br />
QT_TOOLSARCH=clang_64 <br />
QTVER=5.8 <br />
QT5ICUVER=54 #deprecated stuff <br />
</syntaxhighlight><br />
<br />
'''On Linux:''' <br />
(tested on Debian 11)<br />
<syntaxhighlight lang="bash"><br />
QT=/usr<br />
QMAKE=qmake6<br />
QTLIBS=/lib/x86_64-linux-gnu<br />
QTPLUGINS=$(QTLIBS)/qt6/plugins<br />
</syntaxhighlight><br />
<br />
==== 1.12.3 Complete working example Makefile.def for Windows ====<br />
<br />
Here is a working example, you will have to change the filename details to match your setup:<br />
<br />
[[Example Makefile.def file|example Makefile.def file]].<br />
<br />
==== 1.12.4 Fetch additional repositories ====<br />
<br />
Go into just cloned gideros source folder and run make prep.repo<br />
<syntaxhighlight lang="bash"><br />
cd gideros<br />
make -f scripts/Makefile.gid prep.repo <br />
</syntaxhighlight><br />
<br />
If you intend to build the studio, you'll need scintilla and Lexilla libraries. Compile them now with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid qlexilla<br />
make -f scripts/Makefile.gid qscintilla<br />
</syntaxhighlight><br />
<br />
------<br />
<br />
== 2. Building ==<br />
<br />
If you have all dependencies in place for all targets, you can build everything at once via MSYS2 or Terminal with:<br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid<br />
</pre><br />
<br />
=== 2.1 Compilation on PC :===<br />
<br />
Open MSYS2 shell (msys2_shell.cmd). Standard compilation is 32 bit so use a 32 bit shell. Make sure you have installed the necessary build tools in MSYS2 using pacman, as detailed in [[#1.2 (PC) Install MSYS2 Console|Install MSYS2 Console]].<br />
.<br />
<br />
Navigate to gideros folder <br />
<br />
==== 2.1.1 Build QT tools : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid qtapp.install<br />
</pre><br />
<br />
-> files GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in Build.Win folder <br />
<br />
==== 2.1.2 Android: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid android.install <br />
</pre><br />
<br />
= file GiderosAndroidPlayer.apk in folder Build.Win/Players <br />
<br />
==== 2.1.3 winRT: ====<br />
<br />
''If necessary :''<br />
Open the solution, gideros/winRT_example/giderosgame.sln in Visual Studio. Check that the SQLite version for Windows and Windows Phone is up to date. Save and close the solution. <br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid winrt.install <br />
</pre><br />
<br />
= file _bundle.appxupload in folder Build.Win/Players/WinRT<br />
<br />
==== 2.1.4 win32: ====<br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid win32.install <br />
</pre><br />
<br />
= files in folder Build.Win/Templates/win32 <br />
<br />
==== 2.1.5 Html5: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid html5.install<br />
</pre><br />
<br />
-> files in folders Build.Win//Players/Html5 and Build.Win/Templates/Html5<br />
<br />
==== 2.1.6 Plugins: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid bundle.win <br />
</pre><br />
<br />
= folder bin and file gplugin in folder Build.Win/All Plugins<br />
<br />
==== 2.1.7 To build everything that can be built on Windows ====<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid all<br />
</syntaxhighlight><br />
<br />
Then you need to copy all the plugins to the 'Build.Win' folder with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid bundle.win<br />
</syntaxhighlight><br />
<br />
=== 2.2 Compilation on Mac :===<br />
Open Terminal. <br />
<br />
cd to the folder « gideros » <br />
<br />
==== 2.2.1 QT : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid qtapp.install <br />
</pre><br />
<br />
= GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in folder Build.Mac <br />
<br />
==== 2.2.2 iOS : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid ios.install <br />
</pre><br />
<br />
= GiderosiOSPlayer.zip in folder Buid.Mac/Players <br />
<br />
==== 2.2.3 Plugins: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid bundle.mac <br />
</pre><br />
<br />
= folders bin and files gplugin in folder Buid.Mac/All Plugins<br />
<br />
------<br />
<br />
== 3. Cleaning ==<br />
<br />
If you want to reset the build process and start again then you can issue a 'clean' command. To do this type 'make -f scripts/Makefile.gid clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid clean<br />
</syntaxhighlight><br />
<br />
<br />
Sometimes you need to make a clean a particular build. To do this type 'make -f scripts/Makefile.gid ' followed by something like 'html5' then '.clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid html5.clean<br />
</syntaxhighlight></div>Hgy29https://wiki.gideros.rocks/index.php?title=Compiling_Gideros_Source&diff=22474Compiling Gideros Source2023-08-17T13:55:31Z<p>Hgy29: /* 1.12.2 Configure scripts */</p>
<hr />
<div>The following instructions are for developers who want to contribute to or otherwise experiment with the Gideros C/C++ engine and are ''not'' necessary for either building or deploying apps made with Gideros.<br />
<br />
The Gideros project consists of the Gideros Studio IDE, the Gideros SDK libraries, Gideros Texture Packer, Gideros Font Creator, "players" or export templates for all the platforms Gideros supports, all targets of all plugins, a daemon and a bridge. The build system is flexible, so you only need the tools for the targets you are interested in deploying to with Qt (and MSYS2 on Windows) being a realistic minimum.<br />
<br />
<div class="noautonum">__TOC__</div><br />
<br />
== 1. Requirements ==<br />
=== 1.1 Install QT ===<br />
https://www.qt.io/download-open-source/<br />
<br />
Recommended version 6.3 with MinGW <br /><br />
<br />
Double click on the downloaded file and follow instructions. When installing, expand the tree view and ensure you have ticked the MinGW child option of the Qt version checkbox, as well as the MinGW option in the Tools section.<br />
Beside main QT package, you'll need the following additional components:<br />
* WebSocket additional library<br />
* Multimedia additional library<br />
* Qt5 Compatibility addon<br />
<br />
(MAC) Move the created folder into your user account folder <br />
<br />
(LINUX) <br />
On Debian 11:<br />
echo "deb http://deb.debian.org/debian bullseye-backports main" >>/etc/apt/sources.list<br />
apt update<br />
apt install qt6-base-dev qt6-websockets-dev qt6-multimedia-dev qt6-5compat-dev<br />
<br />
Depending on your distribution, you may need to install qt5 websocket lib seperately (sudo apt-get install libqt5websockets5-dev)<br />
<br />
------<br />
<br />
===1.2 (PC) Install MSYS2 Console===<br />
https://msys2.github.io/ <br />
<br />
Double click on the downloaded file (msys2-i686) and follow instructions. <br />
<br />
Open 32 bit MSYS2 shell: msys2_shell.cmd<br />
<syntaxhighlight lang="bash"><br />
pacman –Sy pacman<br />
pacman –Syu<br />
pacman –Su<br />
pacman –S tar<br />
pacman –S zip<br />
pacman –S unzip<br />
pacman –S git<br />
pacman –S base-devel<br />
pacman -S python<br />
#For compiling win32/32bit under a MinGW64<br />
pacman -S mingw-w64-i686-toolchain<br />
pacman -S mingw-w64-i686-glew<br />
pacman -S mingw-w64-i686-curl<br />
pacman -S mingw-w64-i686-libpng<br />
#For compiling win32/64bit under a MinGW64<br />
pacman -S mingw-w64-x86_64-toolchain<br />
pacman -S mingw-w64-x86_64-glew<br />
pacman -S mingw-w64-x86_64-curl<br />
pacman -S mingw-w64-x86_64-libpng<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.3 (Mac) Install Git & xcpretty ===<br />
http://git-scm.com/downloads<br />
<br />
Ctrl + right click, open with « Install program.app » Follow instructions keeping default values as they are. <br />
<br />
(MAC) open a terminal window <br />
<syntaxhighlight lang="bash"><br />
git config –global user.name "your git login" <br />
git config –global user.email "your git email"<br />
sudo gem install xcpretty<br />
</syntaxhighlight><br />
------<br />
=== 1.3.1 (Linux/Debian) Install Git, build-tools ===<br />
<syntaxhighlight lang="bash"><br />
apt install git build-essential libxcb-xinerama0 libgl1-mesa-dev libz-dev libasound2-dev<br />
git config --global user.email "your git email"<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.4 (PC) Android requirements ===<br />
<br />
==== 1.4.1 Install Android Studio and NDK ====<br />
<br />
https://developer.android.com/studio/index.html<br />
https://developer.android.com/ndk/downloads/older_releases.html<br />
<br />
Recommended NDK is 17b (the x86_64 version)<br />
<br />
Once downloaded, copy the contents of the NDK to your home or C: folder, rename the folder that you copied to 'android-ndk', for example you will end up with 'c:\android-ndk' and below that folders that say build, meta, platforms, etc.<br />
<br />
==== 1.4.2 Install Ant (no longer required but kept util someone confirms this)====<br />
https://ant.apache.org/<br />
<br />
Once downloaded, copy the contents of the install archive/zip file to your home folder or C: drive.<br />
Eg: so you have a folder called c:\apache-ant-1.10.5 with bin, etc, lib, manual folders within that.<br />
<br />
==== 1.4.3 Mix Old and New Tools (no longer required but kept util someone confirms this) ====<br />
<br />
Gideros uses Ant to build the player, unfortunately the tools to support Ant are now missing from the latest Android tools.<br />
<br />
<br />
There is a fix for this:<br />
<br />
# Rename the existing 'tools' folder in the Android SDK folder to 'tools_new'.<br />
# Download an older (March 2016) version of the tools and copy that folder to the Android SDK folder.<br />
# Copy the contents of 'tools_new' over the contents of 'tools'.<br />
<br />
Here is where you can download the compatible set of tools from:<br />
<br />
(PC) https://dl.google.com/android/repository/tools_r25.2.5-windows.zip<br />
<br />
(MAC) https://dl.google.com/android/repository/tools_r25.2.5-macosx.zip<br />
<br />
(LINUX) https://dl.google.com/android/repository/tools_r25.2.5-linux.zip<br />
<br />
------<br />
<br />
=== 1.5 Install Java ===<br />
You need the Java JDK<br />
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html<br />
<br />
------<br />
<br />
=== 1.6 (PC) Install Visual Studio ===<br />
https://www.visualstudio.com/downloads/<br />
<br />
Install [https://developer.microsoft.com/en-us/windows/downloads/windows-8-1-sdk Win 8.1 SDK]<br />
<br />
Install [https://marketplace.visualstudio.com/items?itemName=AdMediator.MicrosoftAdvertisingSDKforWindowsandWindowsPhone8x Microsoft Advertising SDK for Windows and Windows Phone 8.x]<br />
<br />
Ensure that you have MSBuild v12 or v14 installed (building with the makefile will fail with an incorrect version).<br />
<br />
------<br />
<br />
=== 1.7 (MAC) Install Xcode ===<br />
https://itunes.apple.com/fr/app/xcode/id497799835?mt=12<br />
<br />
------<br />
<br />
=== 1.8 (Mac) ensure xcode command line tools are working ===<br />
(MAC) Open a terminal window <br />
<syntaxhighlight lang="bash"><br />
sudo xCodebuild –license <br />
quit<br />
agree<br />
</syntaxhighlight><br />
<br /><br />
------<br />
<br />
=== 1.9 Install Python ===<br />
https://www.python.org/downloads/release/python-2712/<br />
<br />
You need Python 2.7.12 or later to install emscripten properly.<br />
<br />
Once installed, add it to your command line path, eg: c:\python27, on windows you can do this by right-clicking on 'myComputer' or 'This PC', go to 'Properties', click 'Advanced System Settings', Click 'Environmental Variables', double-click 'Path', add 'c:\python27'.<br />
<br />
------<br />
<br />
=== 1.10 Install emscripten ===<br />
http://kripken.github.io/emscripten-site/<br />
<br />
You need this is you want to build for HTML5 + Facebook games.<br />
<br />
Using a shell or MSYS2 (previously installed) on windows, go to your home or C: folder and type:<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/juj/emsdk.git<br />
</syntaxhighlight><br />
<br />
Once that has completed open a command prompt in that folder on Windows, on other system just cd to the folder.<br />
<br />
Using emsdk, install and activate all the latest packages:<br />
<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install latest<br />
emsdk activate latest<br />
</syntaxhighlight><br />
<br />
(PC) Type:<br />
<syntaxhighlight lang="bash"><br />
emsdk_env.bat<br />
</syntaxhighlight><br />
<br />
(MAC) Type:<br />
<syntaxhighlight lang="bash"><br />
source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
To use incoming branch of emscripten, use these commands instead:<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install sdk-incoming-64bit<br />
emsdk activate sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
To further use Gideros own git fork of emscripten:<br />
<syntaxhighlight lang="bash"><br />
cd emscripten/incoming<br />
# Add a git remote link to your own repository.<br />
git remote add gideros https://github.com/gideros/emscripten.git<br />
# Obtain the changes in your link.<br />
git fetch gideros<br />
# Switch the emscripten-incoming tool to use your fork.<br />
git checkout -b gideros_incoming --track gideros/incoming<br />
#Get back to emscripten directory and rebuild<br />
cd ../..<br />
emsdk install sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
<br />
These can also be installed within emsdk: git, crunch, and spidermonkey<br />
<syntaxhighlight lang="bash"><br />
(on non-PC put ./ before emsdk)<br />
emsdk install git-1.9.4<br />
emsdk install crunch-1.03<br />
emsdk install spidermonkey-37.0.1-64bit<br />
emsdk activate git-1.9.4<br />
emsdk activate crunch-1.03<br />
emsdk activate spidermonkey-37.0.1-64bit<br />
(PC) emsdk_env.bat<br />
(MAC) source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
(PC) Make sure the environment variable EM_CONFIG is set to the location of your emscripten config file.<br />
<br />
The emscripten build also needs the CMake command. You can download it and extract it to your home or C: folder. Don't forget to add it's path to the end of the EMSDKPATH in Makefile.def.<br />
<br />
https://cmake.org/download/<br />
<br />
------<br />
<br />
=== 1.11 Install Steam SDK ===<br />
https://partner.steamgames.com/?goto=%2Fdownloads%2Fsteamworks_sdk.zip<br />
<br />
Extract the archive/zip file to your home or C: folder, for example if the file is called 'steamworks_sdk_142.zip' then you will have a 'c:\steamworks_sdk_142' folder with a solder called 'sdk' within it. The sdk folder contains other folders such as glmgr, public, tools, etc.<br />
<br />
This is necessary for the Steam plugin.<br />
<br />
------<br />
<br />
=== 1.12 Install Gideros ===<br />
<br />
==== 1.12.1 Fetch gideros source code ====<br />
(PC) Open MSYS2 32 bit shell<br />
<br />
(MAC/Linux) Open a terminal<br />
<br />
Navigate to the folder where you into to work.<br />
<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/gideros/gideros <br />
</syntaxhighlight><br />
<br />
==== 1.12.2 Configure scripts ====<br />
Make a copy of the file gideros/scripts/Makefile.def.example, rename it to Makefile.def and update the file copy according <br />
to your installation. Ensure that the QT\_ARCH and QT_TOOLSARCH paths are formatted correctly according to your Qt <br />
install directory structure (see below that they are named differently by Qt).<br />
<br />
''''''Example:''''''<br />
<br/><br />
'''On PC:'''<br />
<br />
For Qt:<syntaxhighlight lang="bash>QTBASEDIR=/c/Qt<br />
QT_ARCH=mingw53_32<br />
QT_TOOLSARCH=mingw530_32<br />
QTVER=5.9.1<br />
QT5ICUVER=59<br />
<br />
STEAMSDK=/c/Applications/steamworks_sdk_142<br />
export STEAMSDK<br />
</syntaxhighlight><br />
<br/><br />
For Android:<br />
<br />
<syntaxhighlight lang="bash"><br />
# on Windows, also add this to PATH<br />
NDK_HOME=/c/android/android-ndk-r17b<br />
NDKBUILD=cmd //c /c/android/android-ndk-r17b/ndk-build.cmd<br />
#We use windows syntax for this one, as it will be used by gradle.bat script<br />
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144<br />
#Windows syntax with quadruple backslashs!<br />
ANDROID_HOME=C:\\\\Users\\\\Gideros\\\\AppData\\\\Local\\\\Android\\\\sdk<br />
<br />
</syntaxhighlight><br />
<br/><br />
For WinRT:<br />
<br />
<syntaxhighlight lang="bash"><br />
FXC="/c/Program Files (x86)/Windows Kits/8.1/bin/x86/fxc.exe" <br />
MSBUILD="/c/Program Files (x86)/MSBuild/14.0/Bin/MSbuild.exe" <br />
</syntaxhighlight><br />
<br/><br />
<br />
For html5:<br />
<br />
<syntaxhighlight lang="bash"><br />
EMSDK=/c/emsdkwin<br />
EMSDKPATH=$(EMSDK):$(EMSDK)/clang/e1.35.0_64bit:$(EMSDK)/node/4.1.1_64bit/bin:$(EMSDK)/python/2.7.5.3_64bit:$(EMSDK)/emscripten/1.35.0<br />
EMSDK_PREFIX=PATH=$(EMSDKPATH):$$$$PATH cmd //c<br />
CRUNCHME=crunchme-win32.exe<br />
</syntaxhighlight><br />
<br/><br />
'''On MAC:''' <br />
<br />
<syntaxhighlight lang="bash"><br />
QTBASEDIR=~/Qt QT_ARCH=clang_64 <br />
QT_TOOLSARCH=clang_64 <br />
QTVER=5.8 <br />
QT5ICUVER=54 #deprecated stuff <br />
</syntaxhighlight><br />
<br />
'''On Linux:''' <br />
(tested on Debian 11)<br />
<syntaxhighlight lang="bash"><br />
QT=/usr<br />
QMAKE=qmake6<br />
QTLIBS=/lib/x86_64-linux-gnu<br />
QTPLUGINS=$(QTLIBS)/qt6/plugins<br />
</syntaxhighlight><br />
<br />
==== 1.12.3 Complete working example Makefile.def for Windows ====<br />
<br />
Here is a working example, you will have to change the filename details to match your setup:<br />
<br />
[[Example Makefile.def file|example Makefile.def file]].<br />
<br />
==== 1.12.4 Fetch additional repositories ====<br />
<br />
Go into just cloned gideros source folder and run make prep.repo<br />
<syntaxhighlight lang="bash"><br />
cd gideros<br />
make -f scripts/Makefile.gid prep.repo <br />
</syntaxhighlight><br />
<br />
If you intend to build the studio, you'll need scintilla and Lexilla libraries. Compile them now with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid qlexilla<br />
make -f scripts/Makefile.gid qscintilla<br />
</syntaxhighlight><br />
<br />
------<br />
<br />
== 2. Building ==<br />
<br />
If you have all dependencies in place for all targets, you can build everything at once via MSYS2 or Terminal with:<br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid<br />
</pre><br />
<br />
=== 2.1 Compilation on PC :===<br />
<br />
Open MSYS2 shell (msys2_shell.cmd). Standard compilation is 32 bit so use a 32 bit shell. Make sure you have installed the necessary build tools in MSYS2 using pacman, as detailed in [[#1.2 (PC) Install MSYS2 Console|Install MSYS2 Console]].<br />
.<br />
<br />
Navigate to gideros folder <br />
<br />
==== 2.1.1 Build QT tools : ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid qtapp.install<br />
</pre><br />
<br />
-> files GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in Build.Win folder <br />
<br />
==== 2.1.2 Android: ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid android.install <br />
</pre><br />
<br />
= file GiderosAndroidPlayer.apk in folder Build.Win/Players <br />
<br />
==== 2.1.3 winRT: ====<br />
<br />
''If necessary :''<br />
Open the solution, gideros/winRT_example/giderosgame.sln in Visual Studio. Check that the SQLite version for Windows and Windows Phone is up to date. Save and close the solution. <br />
<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid winrt.install <br />
</pre><br />
<br />
= file _bundle.appxupload in folder Build.Win/Players/WinRT<br />
<br />
==== 2.1.4 win32: ====<br />
<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid win32.install <br />
</pre><br />
<br />
= files in folder Build.Win/Templates/win32 <br />
<br />
==== 2.1.5 Html5: ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid html5.install<br />
</pre><br />
<br />
-> files in folders Build.Win//Players/Html5 and Build.Win/Templates/Html5<br />
<br />
==== 2.1.6 Plugins: ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid bundle.win <br />
</pre><br />
<br />
= folder bin and file gplugin in folder Build.Win/All Plugins<br />
<br />
==== 2.1.7 To build everything that can be built on Windows ====<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid all<br />
</syntaxhighlight><br />
<br />
Then you need to copy all the plugins to the 'Build.Win' folder with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid bundle.win<br />
</syntaxhighlight><br />
<br />
=== 2.2 Compilation on Mac :===<br />
Open Terminal. <br />
<br />
cd to the folder « gideros » <br />
<br />
==== 2.2.1 QT : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid qtapp.install <br />
</pre><br />
<br />
= GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in folder Build.Mac <br />
<br />
==== 2.2.2 iOS : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid ios.install <br />
</pre><br />
<br />
= GiderosiOSPlayer.zip in folder Buid.Mac/Players <br />
<br />
==== 2.2.3 Plugins: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid bundle.mac <br />
</pre><br />
<br />
= folders bin and files gplugin in folder Buid.Mac/All Plugins<br />
<br />
------<br />
<br />
== 3. Cleaning ==<br />
<br />
If you want to reset the build process and start again then you can issue a 'clean' command. To do this type 'make -f scripts/Makefile.gid clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid clean<br />
</syntaxhighlight><br />
<br />
<br />
Sometimes you need to make a clean a particular build. To do this type 'make -f scripts/Makefile.gid ' followed by something like 'html5' then '.clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid html5.clean<br />
</syntaxhighlight></div>Hgy29https://wiki.gideros.rocks/index.php?title=Compiling_Gideros_Source&diff=22473Compiling Gideros Source2023-08-17T11:53:14Z<p>Hgy29: /* 1.12.2 Configure scripts */</p>
<hr />
<div>The following instructions are for developers who want to contribute to or otherwise experiment with the Gideros C/C++ engine and are ''not'' necessary for either building or deploying apps made with Gideros.<br />
<br />
The Gideros project consists of the Gideros Studio IDE, the Gideros SDK libraries, Gideros Texture Packer, Gideros Font Creator, "players" or export templates for all the platforms Gideros supports, all targets of all plugins, a daemon and a bridge. The build system is flexible, so you only need the tools for the targets you are interested in deploying to with Qt (and MSYS2 on Windows) being a realistic minimum.<br />
<br />
<div class="noautonum">__TOC__</div><br />
<br />
== 1. Requirements ==<br />
=== 1.1 Install QT ===<br />
https://www.qt.io/download-open-source/<br />
<br />
Recommended version 6.3 with MinGW <br /><br />
<br />
Double click on the downloaded file and follow instructions. When installing, expand the tree view and ensure you have ticked the MinGW child option of the Qt version checkbox, as well as the MinGW option in the Tools section.<br />
Beside main QT package, you'll need the following additional components:<br />
* WebSocket additional library<br />
* Multimedia additional library<br />
* Qt5 Compatibility addon<br />
<br />
(MAC) Move the created folder into your user account folder <br />
<br />
(LINUX) <br />
On Debian 11:<br />
echo "deb http://deb.debian.org/debian bullseye-backports main" >>/etc/apt/sources.list<br />
apt update<br />
apt install qt6-base-dev qt6-websockets-dev qt6-multimedia-dev qt6-5compat-dev<br />
<br />
Depending on your distribution, you may need to install qt5 websocket lib seperately (sudo apt-get install libqt5websockets5-dev)<br />
<br />
------<br />
<br />
===1.2 (PC) Install MSYS2 Console===<br />
https://msys2.github.io/ <br />
<br />
Double click on the downloaded file (msys2-i686) and follow instructions. <br />
<br />
Open 32 bit MSYS2 shell: msys2_shell.cmd<br />
<syntaxhighlight lang="bash"><br />
pacman –Sy pacman<br />
pacman –Syu<br />
pacman –Su<br />
pacman –S tar<br />
pacman –S zip<br />
pacman –S unzip<br />
pacman –S git<br />
pacman –S base-devel<br />
pacman -S python<br />
#For compiling win32/32bit under a MinGW64<br />
pacman -S mingw-w64-i686-toolchain<br />
pacman -S mingw-w64-i686-glew<br />
pacman -S mingw-w64-i686-curl<br />
pacman -S mingw-w64-i686-libpng<br />
#For compiling win32/64bit under a MinGW64<br />
pacman -S mingw-w64-x86_64-toolchain<br />
pacman -S mingw-w64-x86_64-glew<br />
pacman -S mingw-w64-x86_64-curl<br />
pacman -S mingw-w64-x86_64-libpng<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.3 (Mac) Install Git & xcpretty ===<br />
http://git-scm.com/downloads<br />
<br />
Ctrl + right click, open with « Install program.app » Follow instructions keeping default values as they are. <br />
<br />
(MAC) open a terminal window <br />
<syntaxhighlight lang="bash"><br />
git config –global user.name "your git login" <br />
git config –global user.email "your git email"<br />
sudo gem install xcpretty<br />
</syntaxhighlight><br />
------<br />
=== 1.3.1 (Linux/Debian) Install Git, build-tools ===<br />
<syntaxhighlight lang="bash"><br />
apt install git build-essential libxcb-xinerama0 libgl1-mesa-dev libz-dev libasound2-dev<br />
git config --global user.email "your git email"<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.4 (PC) Android requirements ===<br />
<br />
==== 1.4.1 Install Android Studio and NDK ====<br />
<br />
https://developer.android.com/studio/index.html<br />
https://developer.android.com/ndk/downloads/older_releases.html<br />
<br />
Recommended NDK is 17b (the x86_64 version)<br />
<br />
Once downloaded, copy the contents of the NDK to your home or C: folder, rename the folder that you copied to 'android-ndk', for example you will end up with 'c:\android-ndk' and below that folders that say build, meta, platforms, etc.<br />
<br />
==== 1.4.2 Install Ant (no longer required but kept util someone confirms this)====<br />
https://ant.apache.org/<br />
<br />
Once downloaded, copy the contents of the install archive/zip file to your home folder or C: drive.<br />
Eg: so you have a folder called c:\apache-ant-1.10.5 with bin, etc, lib, manual folders within that.<br />
<br />
==== 1.4.3 Mix Old and New Tools (no longer required but kept util someone confirms this) ====<br />
<br />
Gideros uses Ant to build the player, unfortunately the tools to support Ant are now missing from the latest Android tools.<br />
<br />
<br />
There is a fix for this:<br />
<br />
# Rename the existing 'tools' folder in the Android SDK folder to 'tools_new'.<br />
# Download an older (March 2016) version of the tools and copy that folder to the Android SDK folder.<br />
# Copy the contents of 'tools_new' over the contents of 'tools'.<br />
<br />
Here is where you can download the compatible set of tools from:<br />
<br />
(PC) https://dl.google.com/android/repository/tools_r25.2.5-windows.zip<br />
<br />
(MAC) https://dl.google.com/android/repository/tools_r25.2.5-macosx.zip<br />
<br />
(LINUX) https://dl.google.com/android/repository/tools_r25.2.5-linux.zip<br />
<br />
------<br />
<br />
=== 1.5 Install Java ===<br />
You need the Java JDK<br />
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html<br />
<br />
------<br />
<br />
=== 1.6 (PC) Install Visual Studio ===<br />
https://www.visualstudio.com/downloads/<br />
<br />
Install [https://developer.microsoft.com/en-us/windows/downloads/windows-8-1-sdk Win 8.1 SDK]<br />
<br />
Install [https://marketplace.visualstudio.com/items?itemName=AdMediator.MicrosoftAdvertisingSDKforWindowsandWindowsPhone8x Microsoft Advertising SDK for Windows and Windows Phone 8.x]<br />
<br />
Ensure that you have MSBuild v12 or v14 installed (building with the makefile will fail with an incorrect version).<br />
<br />
------<br />
<br />
=== 1.7 (MAC) Install Xcode ===<br />
https://itunes.apple.com/fr/app/xcode/id497799835?mt=12<br />
<br />
------<br />
<br />
=== 1.8 (Mac) ensure xcode command line tools are working ===<br />
(MAC) Open a terminal window <br />
<syntaxhighlight lang="bash"><br />
sudo xCodebuild –license <br />
quit<br />
agree<br />
</syntaxhighlight><br />
<br /><br />
------<br />
<br />
=== 1.9 Install Python ===<br />
https://www.python.org/downloads/release/python-2712/<br />
<br />
You need Python 2.7.12 or later to install emscripten properly.<br />
<br />
Once installed, add it to your command line path, eg: c:\python27, on windows you can do this by right-clicking on 'myComputer' or 'This PC', go to 'Properties', click 'Advanced System Settings', Click 'Environmental Variables', double-click 'Path', add 'c:\python27'.<br />
<br />
------<br />
<br />
=== 1.10 Install emscripten ===<br />
http://kripken.github.io/emscripten-site/<br />
<br />
You need this is you want to build for HTML5 + Facebook games.<br />
<br />
Using a shell or MSYS2 (previously installed) on windows, go to your home or C: folder and type:<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/juj/emsdk.git<br />
</syntaxhighlight><br />
<br />
Once that has completed open a command prompt in that folder on Windows, on other system just cd to the folder.<br />
<br />
Using emsdk, install and activate all the latest packages:<br />
<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install latest<br />
emsdk activate latest<br />
</syntaxhighlight><br />
<br />
(PC) Type:<br />
<syntaxhighlight lang="bash"><br />
emsdk_env.bat<br />
</syntaxhighlight><br />
<br />
(MAC) Type:<br />
<syntaxhighlight lang="bash"><br />
source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
To use incoming branch of emscripten, use these commands instead:<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install sdk-incoming-64bit<br />
emsdk activate sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
To further use Gideros own git fork of emscripten:<br />
<syntaxhighlight lang="bash"><br />
cd emscripten/incoming<br />
# Add a git remote link to your own repository.<br />
git remote add gideros https://github.com/gideros/emscripten.git<br />
# Obtain the changes in your link.<br />
git fetch gideros<br />
# Switch the emscripten-incoming tool to use your fork.<br />
git checkout -b gideros_incoming --track gideros/incoming<br />
#Get back to emscripten directory and rebuild<br />
cd ../..<br />
emsdk install sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
<br />
These can also be installed within emsdk: git, crunch, and spidermonkey<br />
<syntaxhighlight lang="bash"><br />
(on non-PC put ./ before emsdk)<br />
emsdk install git-1.9.4<br />
emsdk install crunch-1.03<br />
emsdk install spidermonkey-37.0.1-64bit<br />
emsdk activate git-1.9.4<br />
emsdk activate crunch-1.03<br />
emsdk activate spidermonkey-37.0.1-64bit<br />
(PC) emsdk_env.bat<br />
(MAC) source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
(PC) Make sure the environment variable EM_CONFIG is set to the location of your emscripten config file.<br />
<br />
The emscripten build also needs the CMake command. You can download it and extract it to your home or C: folder. Don't forget to add it's path to the end of the EMSDKPATH in Makefile.def.<br />
<br />
https://cmake.org/download/<br />
<br />
------<br />
<br />
=== 1.11 Install Steam SDK ===<br />
https://partner.steamgames.com/?goto=%2Fdownloads%2Fsteamworks_sdk.zip<br />
<br />
Extract the archive/zip file to your home or C: folder, for example if the file is called 'steamworks_sdk_142.zip' then you will have a 'c:\steamworks_sdk_142' folder with a solder called 'sdk' within it. The sdk folder contains other folders such as glmgr, public, tools, etc.<br />
<br />
This is necessary for the Steam plugin.<br />
<br />
------<br />
<br />
=== 1.12 Install Gideros ===<br />
<br />
==== 1.12.1 Fetch gideros source code ====<br />
(PC) Open MSYS2 32 bit shell<br />
<br />
(MAC/Linux) Open a terminal<br />
<br />
Navigate to the folder where you into to work.<br />
<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/gideros/gideros <br />
</syntaxhighlight><br />
<br />
==== 1.12.2 Configure scripts ====<br />
Make a copy of the file gideros/scripts/Makefile.def.example, rename it to Makefile.def and update the file copy according <br />
to your installation. Ensure that the QT\_ARCH and QT_TOOLSARCH paths are formatted correctly according to your Qt <br />
install directory structure (see below that they are named differently by Qt).<br />
<br />
''''''Example:''''''<br />
<br/><br />
'''On PC:'''<br />
<br />
For Qt:<syntaxhighlight lang="bash>QTBASEDIR=/c/Qt<br />
QT_ARCH=mingw53_32<br />
QT_TOOLSARCH=mingw530_32<br />
QTVER=5.9.1<br />
QT5ICUVER=59<br />
<br />
STEAMSDK=/c/Applications/steamworks_sdk_142<br />
export STEAMSDK<br />
</syntaxhighlight><br />
<br/><br />
For Android:<br />
<br />
<syntaxhighlight lang="bash"><br />
# on Windows, also add this to PATH<br />
NDK_HOME=/c/android/android-ndk-r17b<br />
NDKBUILD=cmd //c /c/android/android-ndk-r17b/ndk-build.cmd<br />
#We use windows syntax for this one, as it will be used by gradle.bat script<br />
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144<br />
#Windows syntax with quadruple backslashs!<br />
ANDROID_HOME=C:\\\\Users\\\\Gideros\\\\AppData\\\\Local\\\\Android\\\\sdk<br />
<br />
</syntaxhighlight><br />
<br/><br />
For WinRT:<br />
<br />
<syntaxhighlight lang="bash"><br />
FXC="/c/Program Files (x86)/Windows Kits/8.1/bin/x86/fxc.exe" <br />
MSBUILD="/c/Program Files (x86)/MSBuild/14.0/Bin/MSbuild.exe" <br />
</syntaxhighlight><br />
<br/><br />
<br />
For html5:<br />
<br />
<syntaxhighlight lang="bash"><br />
EMSDK=/c/emsdkwin<br />
EMSDKPATH=$(EMSDK):$(EMSDK)/clang/e1.35.0_64bit:$(EMSDK)/node/4.1.1_64bit/bin:$(EMSDK)/python/2.7.5.3_64bit:$(EMSDK)/emscripten/1.35.0<br />
EMSDK_PREFIX=PATH=$(EMSDKPATH):$$$$PATH cmd //c<br />
CRUNCHME=crunchme-win32.exe<br />
</syntaxhighlight><br />
<br/><br />
'''On MAC:''' <br />
<br />
<syntaxhighlight lang="bash"><br />
QTBASEDIR=~/Qt QT_ARCH=clang_64 <br />
QT_TOOLSARCH=clang_64 <br />
QTVER=5.8 <br />
QT5ICUVER=54 #deprecated stuff <br />
</syntaxhighlight><br />
<br />
'''On Linux:''' <br />
(tested on Debian 11)<br />
<syntaxhighlight lang="bash"><br />
QT=/usr<br />
QMAKE=qmake6<br />
</syntaxhighlight><br />
<br />
==== 1.12.3 Complete working example Makefile.def for Windows ====<br />
<br />
Here is a working example, you will have to change the filename details to match your setup:<br />
<br />
[[Example Makefile.def file|example Makefile.def file]].<br />
<br />
==== 1.12.4 Fetch additional repositories ====<br />
<br />
Go into just cloned gideros source folder and run make prep.repo<br />
<syntaxhighlight lang="bash"><br />
cd gideros<br />
make -f scripts/Makefile.gid prep.repo <br />
</syntaxhighlight><br />
<br />
If you intend to build the studio, you'll need scintilla and Lexilla libraries. Compile them now with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid qlexilla<br />
make -f scripts/Makefile.gid qscintilla<br />
</syntaxhighlight><br />
<br />
------<br />
<br />
== 2. Building ==<br />
<br />
If you have all dependencies in place for all targets, you can build everything at once via MSYS2 or Terminal with:<br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid<br />
</pre><br />
<br />
=== 2.1 Compilation on PC :===<br />
<br />
Open MSYS2 shell (msys2_shell.cmd). Standard compilation is 32 bit so use a 32 bit shell. Make sure you have installed the necessary build tools in MSYS2 using pacman, as detailed in [[#1.2 (PC) Install MSYS2 Console|Install MSYS2 Console]].<br />
.<br />
<br />
Navigate to gideros folder <br />
<br />
==== 2.1.1 Build QT tools : ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid qtapp.install<br />
</pre><br />
<br />
-> files GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in Build.Win folder <br />
<br />
==== 2.1.2 Android: ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid android.install <br />
</pre><br />
<br />
= file GiderosAndroidPlayer.apk in folder Build.Win/Players <br />
<br />
==== 2.1.3 winRT: ====<br />
<br />
''If necessary :''<br />
Open the solution, gideros/winRT_example/giderosgame.sln in Visual Studio. Check that the SQLite version for Windows and Windows Phone is up to date. Save and close the solution. <br />
<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid winrt.install <br />
</pre><br />
<br />
= file _bundle.appxupload in folder Build.Win/Players/WinRT<br />
<br />
==== 2.1.4 win32: ====<br />
<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid win32.install <br />
</pre><br />
<br />
= files in folder Build.Win/Templates/win32 <br />
<br />
==== 2.1.5 Html5: ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid html5.install<br />
</pre><br />
<br />
-> files in folders Build.Win//Players/Html5 and Build.Win/Templates/Html5<br />
<br />
==== 2.1.6 Plugins: ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid bundle.win <br />
</pre><br />
<br />
= folder bin and file gplugin in folder Build.Win/All Plugins<br />
<br />
==== 2.1.7 To build everything that can be built on Windows ====<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid all<br />
</syntaxhighlight><br />
<br />
Then you need to copy all the plugins to the 'Build.Win' folder with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid bundle.win<br />
</syntaxhighlight><br />
<br />
=== 2.2 Compilation on Mac :===<br />
Open Terminal. <br />
<br />
cd to the folder « gideros » <br />
<br />
==== 2.2.1 QT : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid qtapp.install <br />
</pre><br />
<br />
= GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in folder Build.Mac <br />
<br />
==== 2.2.2 iOS : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid ios.install <br />
</pre><br />
<br />
= GiderosiOSPlayer.zip in folder Buid.Mac/Players <br />
<br />
==== 2.2.3 Plugins: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid bundle.mac <br />
</pre><br />
<br />
= folders bin and files gplugin in folder Buid.Mac/All Plugins<br />
<br />
------<br />
<br />
== 3. Cleaning ==<br />
<br />
If you want to reset the build process and start again then you can issue a 'clean' command. To do this type 'make -f scripts/Makefile.gid clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid clean<br />
</syntaxhighlight><br />
<br />
<br />
Sometimes you need to make a clean a particular build. To do this type 'make -f scripts/Makefile.gid ' followed by something like 'html5' then '.clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid html5.clean<br />
</syntaxhighlight></div>Hgy29https://wiki.gideros.rocks/index.php?title=Compiling_Gideros_Source&diff=22472Compiling Gideros Source2023-08-17T10:15:09Z<p>Hgy29: /* 1.3.1 (Linux/Debian) Install Git, build-tools */</p>
<hr />
<div>The following instructions are for developers who want to contribute to or otherwise experiment with the Gideros C/C++ engine and are ''not'' necessary for either building or deploying apps made with Gideros.<br />
<br />
The Gideros project consists of the Gideros Studio IDE, the Gideros SDK libraries, Gideros Texture Packer, Gideros Font Creator, "players" or export templates for all the platforms Gideros supports, all targets of all plugins, a daemon and a bridge. The build system is flexible, so you only need the tools for the targets you are interested in deploying to with Qt (and MSYS2 on Windows) being a realistic minimum.<br />
<br />
<div class="noautonum">__TOC__</div><br />
<br />
== 1. Requirements ==<br />
=== 1.1 Install QT ===<br />
https://www.qt.io/download-open-source/<br />
<br />
Recommended version 6.3 with MinGW <br /><br />
<br />
Double click on the downloaded file and follow instructions. When installing, expand the tree view and ensure you have ticked the MinGW child option of the Qt version checkbox, as well as the MinGW option in the Tools section.<br />
Beside main QT package, you'll need the following additional components:<br />
* WebSocket additional library<br />
* Multimedia additional library<br />
* Qt5 Compatibility addon<br />
<br />
(MAC) Move the created folder into your user account folder <br />
<br />
(LINUX) <br />
On Debian 11:<br />
echo "deb http://deb.debian.org/debian bullseye-backports main" >>/etc/apt/sources.list<br />
apt update<br />
apt install qt6-base-dev qt6-websockets-dev qt6-multimedia-dev qt6-5compat-dev<br />
<br />
Depending on your distribution, you may need to install qt5 websocket lib seperately (sudo apt-get install libqt5websockets5-dev)<br />
<br />
------<br />
<br />
===1.2 (PC) Install MSYS2 Console===<br />
https://msys2.github.io/ <br />
<br />
Double click on the downloaded file (msys2-i686) and follow instructions. <br />
<br />
Open 32 bit MSYS2 shell: msys2_shell.cmd<br />
<syntaxhighlight lang="bash"><br />
pacman –Sy pacman<br />
pacman –Syu<br />
pacman –Su<br />
pacman –S tar<br />
pacman –S zip<br />
pacman –S unzip<br />
pacman –S git<br />
pacman –S base-devel<br />
pacman -S python<br />
#For compiling win32/32bit under a MinGW64<br />
pacman -S mingw-w64-i686-toolchain<br />
pacman -S mingw-w64-i686-glew<br />
pacman -S mingw-w64-i686-curl<br />
pacman -S mingw-w64-i686-libpng<br />
#For compiling win32/64bit under a MinGW64<br />
pacman -S mingw-w64-x86_64-toolchain<br />
pacman -S mingw-w64-x86_64-glew<br />
pacman -S mingw-w64-x86_64-curl<br />
pacman -S mingw-w64-x86_64-libpng<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.3 (Mac) Install Git & xcpretty ===<br />
http://git-scm.com/downloads<br />
<br />
Ctrl + right click, open with « Install program.app » Follow instructions keeping default values as they are. <br />
<br />
(MAC) open a terminal window <br />
<syntaxhighlight lang="bash"><br />
git config –global user.name "your git login" <br />
git config –global user.email "your git email"<br />
sudo gem install xcpretty<br />
</syntaxhighlight><br />
------<br />
=== 1.3.1 (Linux/Debian) Install Git, build-tools ===<br />
<syntaxhighlight lang="bash"><br />
apt install git build-essential libxcb-xinerama0 libgl1-mesa-dev libz-dev libasound2-dev<br />
git config --global user.email "your git email"<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.4 (PC) Android requirements ===<br />
<br />
==== 1.4.1 Install Android Studio and NDK ====<br />
<br />
https://developer.android.com/studio/index.html<br />
https://developer.android.com/ndk/downloads/older_releases.html<br />
<br />
Recommended NDK is 17b (the x86_64 version)<br />
<br />
Once downloaded, copy the contents of the NDK to your home or C: folder, rename the folder that you copied to 'android-ndk', for example you will end up with 'c:\android-ndk' and below that folders that say build, meta, platforms, etc.<br />
<br />
==== 1.4.2 Install Ant (no longer required but kept util someone confirms this)====<br />
https://ant.apache.org/<br />
<br />
Once downloaded, copy the contents of the install archive/zip file to your home folder or C: drive.<br />
Eg: so you have a folder called c:\apache-ant-1.10.5 with bin, etc, lib, manual folders within that.<br />
<br />
==== 1.4.3 Mix Old and New Tools (no longer required but kept util someone confirms this) ====<br />
<br />
Gideros uses Ant to build the player, unfortunately the tools to support Ant are now missing from the latest Android tools.<br />
<br />
<br />
There is a fix for this:<br />
<br />
# Rename the existing 'tools' folder in the Android SDK folder to 'tools_new'.<br />
# Download an older (March 2016) version of the tools and copy that folder to the Android SDK folder.<br />
# Copy the contents of 'tools_new' over the contents of 'tools'.<br />
<br />
Here is where you can download the compatible set of tools from:<br />
<br />
(PC) https://dl.google.com/android/repository/tools_r25.2.5-windows.zip<br />
<br />
(MAC) https://dl.google.com/android/repository/tools_r25.2.5-macosx.zip<br />
<br />
(LINUX) https://dl.google.com/android/repository/tools_r25.2.5-linux.zip<br />
<br />
------<br />
<br />
=== 1.5 Install Java ===<br />
You need the Java JDK<br />
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html<br />
<br />
------<br />
<br />
=== 1.6 (PC) Install Visual Studio ===<br />
https://www.visualstudio.com/downloads/<br />
<br />
Install [https://developer.microsoft.com/en-us/windows/downloads/windows-8-1-sdk Win 8.1 SDK]<br />
<br />
Install [https://marketplace.visualstudio.com/items?itemName=AdMediator.MicrosoftAdvertisingSDKforWindowsandWindowsPhone8x Microsoft Advertising SDK for Windows and Windows Phone 8.x]<br />
<br />
Ensure that you have MSBuild v12 or v14 installed (building with the makefile will fail with an incorrect version).<br />
<br />
------<br />
<br />
=== 1.7 (MAC) Install Xcode ===<br />
https://itunes.apple.com/fr/app/xcode/id497799835?mt=12<br />
<br />
------<br />
<br />
=== 1.8 (Mac) ensure xcode command line tools are working ===<br />
(MAC) Open a terminal window <br />
<syntaxhighlight lang="bash"><br />
sudo xCodebuild –license <br />
quit<br />
agree<br />
</syntaxhighlight><br />
<br /><br />
------<br />
<br />
=== 1.9 Install Python ===<br />
https://www.python.org/downloads/release/python-2712/<br />
<br />
You need Python 2.7.12 or later to install emscripten properly.<br />
<br />
Once installed, add it to your command line path, eg: c:\python27, on windows you can do this by right-clicking on 'myComputer' or 'This PC', go to 'Properties', click 'Advanced System Settings', Click 'Environmental Variables', double-click 'Path', add 'c:\python27'.<br />
<br />
------<br />
<br />
=== 1.10 Install emscripten ===<br />
http://kripken.github.io/emscripten-site/<br />
<br />
You need this is you want to build for HTML5 + Facebook games.<br />
<br />
Using a shell or MSYS2 (previously installed) on windows, go to your home or C: folder and type:<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/juj/emsdk.git<br />
</syntaxhighlight><br />
<br />
Once that has completed open a command prompt in that folder on Windows, on other system just cd to the folder.<br />
<br />
Using emsdk, install and activate all the latest packages:<br />
<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install latest<br />
emsdk activate latest<br />
</syntaxhighlight><br />
<br />
(PC) Type:<br />
<syntaxhighlight lang="bash"><br />
emsdk_env.bat<br />
</syntaxhighlight><br />
<br />
(MAC) Type:<br />
<syntaxhighlight lang="bash"><br />
source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
To use incoming branch of emscripten, use these commands instead:<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install sdk-incoming-64bit<br />
emsdk activate sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
To further use Gideros own git fork of emscripten:<br />
<syntaxhighlight lang="bash"><br />
cd emscripten/incoming<br />
# Add a git remote link to your own repository.<br />
git remote add gideros https://github.com/gideros/emscripten.git<br />
# Obtain the changes in your link.<br />
git fetch gideros<br />
# Switch the emscripten-incoming tool to use your fork.<br />
git checkout -b gideros_incoming --track gideros/incoming<br />
#Get back to emscripten directory and rebuild<br />
cd ../..<br />
emsdk install sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
<br />
These can also be installed within emsdk: git, crunch, and spidermonkey<br />
<syntaxhighlight lang="bash"><br />
(on non-PC put ./ before emsdk)<br />
emsdk install git-1.9.4<br />
emsdk install crunch-1.03<br />
emsdk install spidermonkey-37.0.1-64bit<br />
emsdk activate git-1.9.4<br />
emsdk activate crunch-1.03<br />
emsdk activate spidermonkey-37.0.1-64bit<br />
(PC) emsdk_env.bat<br />
(MAC) source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
(PC) Make sure the environment variable EM_CONFIG is set to the location of your emscripten config file.<br />
<br />
The emscripten build also needs the CMake command. You can download it and extract it to your home or C: folder. Don't forget to add it's path to the end of the EMSDKPATH in Makefile.def.<br />
<br />
https://cmake.org/download/<br />
<br />
------<br />
<br />
=== 1.11 Install Steam SDK ===<br />
https://partner.steamgames.com/?goto=%2Fdownloads%2Fsteamworks_sdk.zip<br />
<br />
Extract the archive/zip file to your home or C: folder, for example if the file is called 'steamworks_sdk_142.zip' then you will have a 'c:\steamworks_sdk_142' folder with a solder called 'sdk' within it. The sdk folder contains other folders such as glmgr, public, tools, etc.<br />
<br />
This is necessary for the Steam plugin.<br />
<br />
------<br />
<br />
=== 1.12 Install Gideros ===<br />
<br />
==== 1.12.1 Fetch gideros source code ====<br />
(PC) Open MSYS2 32 bit shell<br />
<br />
(MAC/Linux) Open a terminal<br />
<br />
Navigate to the folder where you into to work.<br />
<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/gideros/gideros <br />
</syntaxhighlight><br />
<br />
==== 1.12.2 Configure scripts ====<br />
Make a copy of the file gideros/scripts/Makefile.def.example, rename it to Makefile.def and update the file copy according <br />
to your installation. Ensure that the QT\_ARCH and QT_TOOLSARCH paths are formatted correctly according to your Qt <br />
install directory structure (see below that they are named differently by Qt).<br />
<br />
''''''Example:''''''<br />
<br/><br />
'''On PC:'''<br />
<br />
For Qt:<syntaxhighlight lang="bash>QTBASEDIR=/c/Qt<br />
QT_ARCH=mingw53_32<br />
QT_TOOLSARCH=mingw530_32<br />
QTVER=5.9.1<br />
QT5ICUVER=59<br />
<br />
STEAMSDK=/c/Applications/steamworks_sdk_142<br />
export STEAMSDK<br />
</syntaxhighlight><br />
<br/><br />
For Android:<br />
<br />
<syntaxhighlight lang="bash"><br />
# on Windows, also add this to PATH<br />
NDK_HOME=/c/android/android-ndk-r17b<br />
NDKBUILD=cmd //c /c/android/android-ndk-r17b/ndk-build.cmd<br />
#We use windows syntax for this one, as it will be used by gradle.bat script<br />
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144<br />
#Windows syntax with quadruple backslashs!<br />
ANDROID_HOME=C:\\\\Users\\\\Gideros\\\\AppData\\\\Local\\\\Android\\\\sdk<br />
<br />
</syntaxhighlight><br />
<br/><br />
For WinRT:<br />
<br />
<syntaxhighlight lang="bash"><br />
FXC="/c/Program Files (x86)/Windows Kits/8.1/bin/x86/fxc.exe" <br />
MSBUILD="/c/Program Files (x86)/MSBuild/14.0/Bin/MSbuild.exe" <br />
</syntaxhighlight><br />
<br/><br />
<br />
For html5:<br />
<br />
<syntaxhighlight lang="bash"><br />
EMSDK=/c/emsdkwin<br />
EMSDKPATH=$(EMSDK):$(EMSDK)/clang/e1.35.0_64bit:$(EMSDK)/node/4.1.1_64bit/bin:$(EMSDK)/python/2.7.5.3_64bit:$(EMSDK)/emscripten/1.35.0<br />
EMSDK_PREFIX=PATH=$(EMSDKPATH):$$$$PATH cmd //c<br />
CRUNCHME=crunchme-win32.exe<br />
</syntaxhighlight><br />
<br/><br />
'''On MAC:''' <br />
<br />
<syntaxhighlight lang="bash"><br />
QTBASEDIR=~/Qt QT_ARCH=clang_64 <br />
QT_TOOLSARCH=clang_64 <br />
QTVER=5.8 <br />
QT5ICUVER=54 #deprecated stuff <br />
</syntaxhighlight><br />
<br />
'''On Linux:''' <br />
<br />
<syntaxhighlight lang="bash"><br />
QMAKE=qmake6<br />
</syntaxhighlight><br />
<br />
==== 1.12.3 Complete working example Makefile.def for Windows ====<br />
<br />
Here is a working example, you will have to change the filename details to match your setup:<br />
<br />
[[Example Makefile.def file|example Makefile.def file]].<br />
<br />
==== 1.12.4 Fetch additional repositories ====<br />
<br />
Go into just cloned gideros source folder and run make prep.repo<br />
<syntaxhighlight lang="bash"><br />
cd gideros<br />
make -f scripts/Makefile.gid prep.repo <br />
</syntaxhighlight><br />
<br />
If you intend to build the studio, you'll need scintilla and Lexilla libraries. Compile them now with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid qlexilla<br />
make -f scripts/Makefile.gid qscintilla<br />
</syntaxhighlight><br />
<br />
------<br />
<br />
== 2. Building ==<br />
<br />
If you have all dependencies in place for all targets, you can build everything at once via MSYS2 or Terminal with:<br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid<br />
</pre><br />
<br />
=== 2.1 Compilation on PC :===<br />
<br />
Open MSYS2 shell (msys2_shell.cmd). Standard compilation is 32 bit so use a 32 bit shell. Make sure you have installed the necessary build tools in MSYS2 using pacman, as detailed in [[#1.2 (PC) Install MSYS2 Console|Install MSYS2 Console]].<br />
.<br />
<br />
Navigate to gideros folder <br />
<br />
==== 2.1.1 Build QT tools : ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid qtapp.install<br />
</pre><br />
<br />
-> files GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in Build.Win folder <br />
<br />
==== 2.1.2 Android: ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid android.install <br />
</pre><br />
<br />
= file GiderosAndroidPlayer.apk in folder Build.Win/Players <br />
<br />
==== 2.1.3 winRT: ====<br />
<br />
''If necessary :''<br />
Open the solution, gideros/winRT_example/giderosgame.sln in Visual Studio. Check that the SQLite version for Windows and Windows Phone is up to date. Save and close the solution. <br />
<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid winrt.install <br />
</pre><br />
<br />
= file _bundle.appxupload in folder Build.Win/Players/WinRT<br />
<br />
==== 2.1.4 win32: ====<br />
<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid win32.install <br />
</pre><br />
<br />
= files in folder Build.Win/Templates/win32 <br />
<br />
==== 2.1.5 Html5: ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid html5.install<br />
</pre><br />
<br />
-> files in folders Build.Win//Players/Html5 and Build.Win/Templates/Html5<br />
<br />
==== 2.1.6 Plugins: ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid bundle.win <br />
</pre><br />
<br />
= folder bin and file gplugin in folder Build.Win/All Plugins<br />
<br />
==== 2.1.7 To build everything that can be built on Windows ====<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid all<br />
</syntaxhighlight><br />
<br />
Then you need to copy all the plugins to the 'Build.Win' folder with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid bundle.win<br />
</syntaxhighlight><br />
<br />
=== 2.2 Compilation on Mac :===<br />
Open Terminal. <br />
<br />
cd to the folder « gideros » <br />
<br />
==== 2.2.1 QT : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid qtapp.install <br />
</pre><br />
<br />
= GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in folder Build.Mac <br />
<br />
==== 2.2.2 iOS : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid ios.install <br />
</pre><br />
<br />
= GiderosiOSPlayer.zip in folder Buid.Mac/Players <br />
<br />
==== 2.2.3 Plugins: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid bundle.mac <br />
</pre><br />
<br />
= folders bin and files gplugin in folder Buid.Mac/All Plugins<br />
<br />
------<br />
<br />
== 3. Cleaning ==<br />
<br />
If you want to reset the build process and start again then you can issue a 'clean' command. To do this type 'make -f scripts/Makefile.gid clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid clean<br />
</syntaxhighlight><br />
<br />
<br />
Sometimes you need to make a clean a particular build. To do this type 'make -f scripts/Makefile.gid ' followed by something like 'html5' then '.clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid html5.clean<br />
</syntaxhighlight></div>Hgy29https://wiki.gideros.rocks/index.php?title=Compiling_Gideros_Source&diff=22471Compiling Gideros Source2023-08-17T09:36:35Z<p>Hgy29: /* 1.12.2 Configure scripts */</p>
<hr />
<div>The following instructions are for developers who want to contribute to or otherwise experiment with the Gideros C/C++ engine and are ''not'' necessary for either building or deploying apps made with Gideros.<br />
<br />
The Gideros project consists of the Gideros Studio IDE, the Gideros SDK libraries, Gideros Texture Packer, Gideros Font Creator, "players" or export templates for all the platforms Gideros supports, all targets of all plugins, a daemon and a bridge. The build system is flexible, so you only need the tools for the targets you are interested in deploying to with Qt (and MSYS2 on Windows) being a realistic minimum.<br />
<br />
<div class="noautonum">__TOC__</div><br />
<br />
== 1. Requirements ==<br />
=== 1.1 Install QT ===<br />
https://www.qt.io/download-open-source/<br />
<br />
Recommended version 6.3 with MinGW <br /><br />
<br />
Double click on the downloaded file and follow instructions. When installing, expand the tree view and ensure you have ticked the MinGW child option of the Qt version checkbox, as well as the MinGW option in the Tools section.<br />
Beside main QT package, you'll need the following additional components:<br />
* WebSocket additional library<br />
* Multimedia additional library<br />
* Qt5 Compatibility addon<br />
<br />
(MAC) Move the created folder into your user account folder <br />
<br />
(LINUX) <br />
On Debian 11:<br />
echo "deb http://deb.debian.org/debian bullseye-backports main" >>/etc/apt/sources.list<br />
apt update<br />
apt install qt6-base-dev qt6-websockets-dev qt6-multimedia-dev qt6-5compat-dev<br />
<br />
Depending on your distribution, you may need to install qt5 websocket lib seperately (sudo apt-get install libqt5websockets5-dev)<br />
<br />
------<br />
<br />
===1.2 (PC) Install MSYS2 Console===<br />
https://msys2.github.io/ <br />
<br />
Double click on the downloaded file (msys2-i686) and follow instructions. <br />
<br />
Open 32 bit MSYS2 shell: msys2_shell.cmd<br />
<syntaxhighlight lang="bash"><br />
pacman –Sy pacman<br />
pacman –Syu<br />
pacman –Su<br />
pacman –S tar<br />
pacman –S zip<br />
pacman –S unzip<br />
pacman –S git<br />
pacman –S base-devel<br />
pacman -S python<br />
#For compiling win32/32bit under a MinGW64<br />
pacman -S mingw-w64-i686-toolchain<br />
pacman -S mingw-w64-i686-glew<br />
pacman -S mingw-w64-i686-curl<br />
pacman -S mingw-w64-i686-libpng<br />
#For compiling win32/64bit under a MinGW64<br />
pacman -S mingw-w64-x86_64-toolchain<br />
pacman -S mingw-w64-x86_64-glew<br />
pacman -S mingw-w64-x86_64-curl<br />
pacman -S mingw-w64-x86_64-libpng<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.3 (Mac) Install Git & xcpretty ===<br />
http://git-scm.com/downloads<br />
<br />
Ctrl + right click, open with « Install program.app » Follow instructions keeping default values as they are. <br />
<br />
(MAC) open a terminal window <br />
<syntaxhighlight lang="bash"><br />
git config –global user.name "your git login" <br />
git config –global user.email "your git email"<br />
sudo gem install xcpretty<br />
</syntaxhighlight><br />
------<br />
=== 1.3.1 (Linux/Debian) Install Git, build-tools ===<br />
<syntaxhighlight lang="bash"><br />
apt install git build-essential libxcb-xinerama0 libgl1-mesa-dev libz-dev<br />
git config --global user.email "your git email"<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.4 (PC) Android requirements ===<br />
<br />
==== 1.4.1 Install Android Studio and NDK ====<br />
<br />
https://developer.android.com/studio/index.html<br />
https://developer.android.com/ndk/downloads/older_releases.html<br />
<br />
Recommended NDK is 17b (the x86_64 version)<br />
<br />
Once downloaded, copy the contents of the NDK to your home or C: folder, rename the folder that you copied to 'android-ndk', for example you will end up with 'c:\android-ndk' and below that folders that say build, meta, platforms, etc.<br />
<br />
==== 1.4.2 Install Ant (no longer required but kept util someone confirms this)====<br />
https://ant.apache.org/<br />
<br />
Once downloaded, copy the contents of the install archive/zip file to your home folder or C: drive.<br />
Eg: so you have a folder called c:\apache-ant-1.10.5 with bin, etc, lib, manual folders within that.<br />
<br />
==== 1.4.3 Mix Old and New Tools (no longer required but kept util someone confirms this) ====<br />
<br />
Gideros uses Ant to build the player, unfortunately the tools to support Ant are now missing from the latest Android tools.<br />
<br />
<br />
There is a fix for this:<br />
<br />
# Rename the existing 'tools' folder in the Android SDK folder to 'tools_new'.<br />
# Download an older (March 2016) version of the tools and copy that folder to the Android SDK folder.<br />
# Copy the contents of 'tools_new' over the contents of 'tools'.<br />
<br />
Here is where you can download the compatible set of tools from:<br />
<br />
(PC) https://dl.google.com/android/repository/tools_r25.2.5-windows.zip<br />
<br />
(MAC) https://dl.google.com/android/repository/tools_r25.2.5-macosx.zip<br />
<br />
(LINUX) https://dl.google.com/android/repository/tools_r25.2.5-linux.zip<br />
<br />
------<br />
<br />
=== 1.5 Install Java ===<br />
You need the Java JDK<br />
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html<br />
<br />
------<br />
<br />
=== 1.6 (PC) Install Visual Studio ===<br />
https://www.visualstudio.com/downloads/<br />
<br />
Install [https://developer.microsoft.com/en-us/windows/downloads/windows-8-1-sdk Win 8.1 SDK]<br />
<br />
Install [https://marketplace.visualstudio.com/items?itemName=AdMediator.MicrosoftAdvertisingSDKforWindowsandWindowsPhone8x Microsoft Advertising SDK for Windows and Windows Phone 8.x]<br />
<br />
Ensure that you have MSBuild v12 or v14 installed (building with the makefile will fail with an incorrect version).<br />
<br />
------<br />
<br />
=== 1.7 (MAC) Install Xcode ===<br />
https://itunes.apple.com/fr/app/xcode/id497799835?mt=12<br />
<br />
------<br />
<br />
=== 1.8 (Mac) ensure xcode command line tools are working ===<br />
(MAC) Open a terminal window <br />
<syntaxhighlight lang="bash"><br />
sudo xCodebuild –license <br />
quit<br />
agree<br />
</syntaxhighlight><br />
<br /><br />
------<br />
<br />
=== 1.9 Install Python ===<br />
https://www.python.org/downloads/release/python-2712/<br />
<br />
You need Python 2.7.12 or later to install emscripten properly.<br />
<br />
Once installed, add it to your command line path, eg: c:\python27, on windows you can do this by right-clicking on 'myComputer' or 'This PC', go to 'Properties', click 'Advanced System Settings', Click 'Environmental Variables', double-click 'Path', add 'c:\python27'.<br />
<br />
------<br />
<br />
=== 1.10 Install emscripten ===<br />
http://kripken.github.io/emscripten-site/<br />
<br />
You need this is you want to build for HTML5 + Facebook games.<br />
<br />
Using a shell or MSYS2 (previously installed) on windows, go to your home or C: folder and type:<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/juj/emsdk.git<br />
</syntaxhighlight><br />
<br />
Once that has completed open a command prompt in that folder on Windows, on other system just cd to the folder.<br />
<br />
Using emsdk, install and activate all the latest packages:<br />
<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install latest<br />
emsdk activate latest<br />
</syntaxhighlight><br />
<br />
(PC) Type:<br />
<syntaxhighlight lang="bash"><br />
emsdk_env.bat<br />
</syntaxhighlight><br />
<br />
(MAC) Type:<br />
<syntaxhighlight lang="bash"><br />
source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
To use incoming branch of emscripten, use these commands instead:<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install sdk-incoming-64bit<br />
emsdk activate sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
To further use Gideros own git fork of emscripten:<br />
<syntaxhighlight lang="bash"><br />
cd emscripten/incoming<br />
# Add a git remote link to your own repository.<br />
git remote add gideros https://github.com/gideros/emscripten.git<br />
# Obtain the changes in your link.<br />
git fetch gideros<br />
# Switch the emscripten-incoming tool to use your fork.<br />
git checkout -b gideros_incoming --track gideros/incoming<br />
#Get back to emscripten directory and rebuild<br />
cd ../..<br />
emsdk install sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
<br />
These can also be installed within emsdk: git, crunch, and spidermonkey<br />
<syntaxhighlight lang="bash"><br />
(on non-PC put ./ before emsdk)<br />
emsdk install git-1.9.4<br />
emsdk install crunch-1.03<br />
emsdk install spidermonkey-37.0.1-64bit<br />
emsdk activate git-1.9.4<br />
emsdk activate crunch-1.03<br />
emsdk activate spidermonkey-37.0.1-64bit<br />
(PC) emsdk_env.bat<br />
(MAC) source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
(PC) Make sure the environment variable EM_CONFIG is set to the location of your emscripten config file.<br />
<br />
The emscripten build also needs the CMake command. You can download it and extract it to your home or C: folder. Don't forget to add it's path to the end of the EMSDKPATH in Makefile.def.<br />
<br />
https://cmake.org/download/<br />
<br />
------<br />
<br />
=== 1.11 Install Steam SDK ===<br />
https://partner.steamgames.com/?goto=%2Fdownloads%2Fsteamworks_sdk.zip<br />
<br />
Extract the archive/zip file to your home or C: folder, for example if the file is called 'steamworks_sdk_142.zip' then you will have a 'c:\steamworks_sdk_142' folder with a solder called 'sdk' within it. The sdk folder contains other folders such as glmgr, public, tools, etc.<br />
<br />
This is necessary for the Steam plugin.<br />
<br />
------<br />
<br />
=== 1.12 Install Gideros ===<br />
<br />
==== 1.12.1 Fetch gideros source code ====<br />
(PC) Open MSYS2 32 bit shell<br />
<br />
(MAC/Linux) Open a terminal<br />
<br />
Navigate to the folder where you into to work.<br />
<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/gideros/gideros <br />
</syntaxhighlight><br />
<br />
==== 1.12.2 Configure scripts ====<br />
Make a copy of the file gideros/scripts/Makefile.def.example, rename it to Makefile.def and update the file copy according <br />
to your installation. Ensure that the QT\_ARCH and QT_TOOLSARCH paths are formatted correctly according to your Qt <br />
install directory structure (see below that they are named differently by Qt).<br />
<br />
''''''Example:''''''<br />
<br/><br />
'''On PC:'''<br />
<br />
For Qt:<syntaxhighlight lang="bash>QTBASEDIR=/c/Qt<br />
QT_ARCH=mingw53_32<br />
QT_TOOLSARCH=mingw530_32<br />
QTVER=5.9.1<br />
QT5ICUVER=59<br />
<br />
STEAMSDK=/c/Applications/steamworks_sdk_142<br />
export STEAMSDK<br />
</syntaxhighlight><br />
<br/><br />
For Android:<br />
<br />
<syntaxhighlight lang="bash"><br />
# on Windows, also add this to PATH<br />
NDK_HOME=/c/android/android-ndk-r17b<br />
NDKBUILD=cmd //c /c/android/android-ndk-r17b/ndk-build.cmd<br />
#We use windows syntax for this one, as it will be used by gradle.bat script<br />
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144<br />
#Windows syntax with quadruple backslashs!<br />
ANDROID_HOME=C:\\\\Users\\\\Gideros\\\\AppData\\\\Local\\\\Android\\\\sdk<br />
<br />
</syntaxhighlight><br />
<br/><br />
For WinRT:<br />
<br />
<syntaxhighlight lang="bash"><br />
FXC="/c/Program Files (x86)/Windows Kits/8.1/bin/x86/fxc.exe" <br />
MSBUILD="/c/Program Files (x86)/MSBuild/14.0/Bin/MSbuild.exe" <br />
</syntaxhighlight><br />
<br/><br />
<br />
For html5:<br />
<br />
<syntaxhighlight lang="bash"><br />
EMSDK=/c/emsdkwin<br />
EMSDKPATH=$(EMSDK):$(EMSDK)/clang/e1.35.0_64bit:$(EMSDK)/node/4.1.1_64bit/bin:$(EMSDK)/python/2.7.5.3_64bit:$(EMSDK)/emscripten/1.35.0<br />
EMSDK_PREFIX=PATH=$(EMSDKPATH):$$$$PATH cmd //c<br />
CRUNCHME=crunchme-win32.exe<br />
</syntaxhighlight><br />
<br/><br />
'''On MAC:''' <br />
<br />
<syntaxhighlight lang="bash"><br />
QTBASEDIR=~/Qt QT_ARCH=clang_64 <br />
QT_TOOLSARCH=clang_64 <br />
QTVER=5.8 <br />
QT5ICUVER=54 #deprecated stuff <br />
</syntaxhighlight><br />
<br />
'''On Linux:''' <br />
<br />
<syntaxhighlight lang="bash"><br />
QMAKE=qmake6<br />
</syntaxhighlight><br />
<br />
==== 1.12.3 Complete working example Makefile.def for Windows ====<br />
<br />
Here is a working example, you will have to change the filename details to match your setup:<br />
<br />
[[Example Makefile.def file|example Makefile.def file]].<br />
<br />
==== 1.12.4 Fetch additional repositories ====<br />
<br />
Go into just cloned gideros source folder and run make prep.repo<br />
<syntaxhighlight lang="bash"><br />
cd gideros<br />
make -f scripts/Makefile.gid prep.repo <br />
</syntaxhighlight><br />
<br />
If you intend to build the studio, you'll need scintilla and Lexilla libraries. Compile them now with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid qlexilla<br />
make -f scripts/Makefile.gid qscintilla<br />
</syntaxhighlight><br />
<br />
------<br />
<br />
== 2. Building ==<br />
<br />
If you have all dependencies in place for all targets, you can build everything at once via MSYS2 or Terminal with:<br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid<br />
</pre><br />
<br />
=== 2.1 Compilation on PC :===<br />
<br />
Open MSYS2 shell (msys2_shell.cmd). Standard compilation is 32 bit so use a 32 bit shell. Make sure you have installed the necessary build tools in MSYS2 using pacman, as detailed in [[#1.2 (PC) Install MSYS2 Console|Install MSYS2 Console]].<br />
.<br />
<br />
Navigate to gideros folder <br />
<br />
==== 2.1.1 Build QT tools : ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid qtapp.install<br />
</pre><br />
<br />
-> files GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in Build.Win folder <br />
<br />
==== 2.1.2 Android: ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid android.install <br />
</pre><br />
<br />
= file GiderosAndroidPlayer.apk in folder Build.Win/Players <br />
<br />
==== 2.1.3 winRT: ====<br />
<br />
''If necessary :''<br />
Open the solution, gideros/winRT_example/giderosgame.sln in Visual Studio. Check that the SQLite version for Windows and Windows Phone is up to date. Save and close the solution. <br />
<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid winrt.install <br />
</pre><br />
<br />
= file _bundle.appxupload in folder Build.Win/Players/WinRT<br />
<br />
==== 2.1.4 win32: ====<br />
<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid win32.install <br />
</pre><br />
<br />
= files in folder Build.Win/Templates/win32 <br />
<br />
==== 2.1.5 Html5: ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid html5.install<br />
</pre><br />
<br />
-> files in folders Build.Win//Players/Html5 and Build.Win/Templates/Html5<br />
<br />
==== 2.1.6 Plugins: ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid bundle.win <br />
</pre><br />
<br />
= folder bin and file gplugin in folder Build.Win/All Plugins<br />
<br />
==== 2.1.7 To build everything that can be built on Windows ====<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid all<br />
</syntaxhighlight><br />
<br />
Then you need to copy all the plugins to the 'Build.Win' folder with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid bundle.win<br />
</syntaxhighlight><br />
<br />
=== 2.2 Compilation on Mac :===<br />
Open Terminal. <br />
<br />
cd to the folder « gideros » <br />
<br />
==== 2.2.1 QT : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid qtapp.install <br />
</pre><br />
<br />
= GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in folder Build.Mac <br />
<br />
==== 2.2.2 iOS : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid ios.install <br />
</pre><br />
<br />
= GiderosiOSPlayer.zip in folder Buid.Mac/Players <br />
<br />
==== 2.2.3 Plugins: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid bundle.mac <br />
</pre><br />
<br />
= folders bin and files gplugin in folder Buid.Mac/All Plugins<br />
<br />
------<br />
<br />
== 3. Cleaning ==<br />
<br />
If you want to reset the build process and start again then you can issue a 'clean' command. To do this type 'make -f scripts/Makefile.gid clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid clean<br />
</syntaxhighlight><br />
<br />
<br />
Sometimes you need to make a clean a particular build. To do this type 'make -f scripts/Makefile.gid ' followed by something like 'html5' then '.clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid html5.clean<br />
</syntaxhighlight></div>Hgy29https://wiki.gideros.rocks/index.php?title=Compiling_Gideros_Source&diff=22470Compiling Gideros Source2023-08-17T09:27:29Z<p>Hgy29: /* 1.1 Install QT */</p>
<hr />
<div>The following instructions are for developers who want to contribute to or otherwise experiment with the Gideros C/C++ engine and are ''not'' necessary for either building or deploying apps made with Gideros.<br />
<br />
The Gideros project consists of the Gideros Studio IDE, the Gideros SDK libraries, Gideros Texture Packer, Gideros Font Creator, "players" or export templates for all the platforms Gideros supports, all targets of all plugins, a daemon and a bridge. The build system is flexible, so you only need the tools for the targets you are interested in deploying to with Qt (and MSYS2 on Windows) being a realistic minimum.<br />
<br />
<div class="noautonum">__TOC__</div><br />
<br />
== 1. Requirements ==<br />
=== 1.1 Install QT ===<br />
https://www.qt.io/download-open-source/<br />
<br />
Recommended version 6.3 with MinGW <br /><br />
<br />
Double click on the downloaded file and follow instructions. When installing, expand the tree view and ensure you have ticked the MinGW child option of the Qt version checkbox, as well as the MinGW option in the Tools section.<br />
Beside main QT package, you'll need the following additional components:<br />
* WebSocket additional library<br />
* Multimedia additional library<br />
* Qt5 Compatibility addon<br />
<br />
(MAC) Move the created folder into your user account folder <br />
<br />
(LINUX) <br />
On Debian 11:<br />
echo "deb http://deb.debian.org/debian bullseye-backports main" >>/etc/apt/sources.list<br />
apt update<br />
apt install qt6-base-dev qt6-websockets-dev qt6-multimedia-dev qt6-5compat-dev<br />
<br />
Depending on your distribution, you may need to install qt5 websocket lib seperately (sudo apt-get install libqt5websockets5-dev)<br />
<br />
------<br />
<br />
===1.2 (PC) Install MSYS2 Console===<br />
https://msys2.github.io/ <br />
<br />
Double click on the downloaded file (msys2-i686) and follow instructions. <br />
<br />
Open 32 bit MSYS2 shell: msys2_shell.cmd<br />
<syntaxhighlight lang="bash"><br />
pacman –Sy pacman<br />
pacman –Syu<br />
pacman –Su<br />
pacman –S tar<br />
pacman –S zip<br />
pacman –S unzip<br />
pacman –S git<br />
pacman –S base-devel<br />
pacman -S python<br />
#For compiling win32/32bit under a MinGW64<br />
pacman -S mingw-w64-i686-toolchain<br />
pacman -S mingw-w64-i686-glew<br />
pacman -S mingw-w64-i686-curl<br />
pacman -S mingw-w64-i686-libpng<br />
#For compiling win32/64bit under a MinGW64<br />
pacman -S mingw-w64-x86_64-toolchain<br />
pacman -S mingw-w64-x86_64-glew<br />
pacman -S mingw-w64-x86_64-curl<br />
pacman -S mingw-w64-x86_64-libpng<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.3 (Mac) Install Git & xcpretty ===<br />
http://git-scm.com/downloads<br />
<br />
Ctrl + right click, open with « Install program.app » Follow instructions keeping default values as they are. <br />
<br />
(MAC) open a terminal window <br />
<syntaxhighlight lang="bash"><br />
git config –global user.name "your git login" <br />
git config –global user.email "your git email"<br />
sudo gem install xcpretty<br />
</syntaxhighlight><br />
------<br />
=== 1.3.1 (Linux/Debian) Install Git, build-tools ===<br />
<syntaxhighlight lang="bash"><br />
apt install git build-essential libxcb-xinerama0 libgl1-mesa-dev libz-dev<br />
git config --global user.email "your git email"<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.4 (PC) Android requirements ===<br />
<br />
==== 1.4.1 Install Android Studio and NDK ====<br />
<br />
https://developer.android.com/studio/index.html<br />
https://developer.android.com/ndk/downloads/older_releases.html<br />
<br />
Recommended NDK is 17b (the x86_64 version)<br />
<br />
Once downloaded, copy the contents of the NDK to your home or C: folder, rename the folder that you copied to 'android-ndk', for example you will end up with 'c:\android-ndk' and below that folders that say build, meta, platforms, etc.<br />
<br />
==== 1.4.2 Install Ant (no longer required but kept util someone confirms this)====<br />
https://ant.apache.org/<br />
<br />
Once downloaded, copy the contents of the install archive/zip file to your home folder or C: drive.<br />
Eg: so you have a folder called c:\apache-ant-1.10.5 with bin, etc, lib, manual folders within that.<br />
<br />
==== 1.4.3 Mix Old and New Tools (no longer required but kept util someone confirms this) ====<br />
<br />
Gideros uses Ant to build the player, unfortunately the tools to support Ant are now missing from the latest Android tools.<br />
<br />
<br />
There is a fix for this:<br />
<br />
# Rename the existing 'tools' folder in the Android SDK folder to 'tools_new'.<br />
# Download an older (March 2016) version of the tools and copy that folder to the Android SDK folder.<br />
# Copy the contents of 'tools_new' over the contents of 'tools'.<br />
<br />
Here is where you can download the compatible set of tools from:<br />
<br />
(PC) https://dl.google.com/android/repository/tools_r25.2.5-windows.zip<br />
<br />
(MAC) https://dl.google.com/android/repository/tools_r25.2.5-macosx.zip<br />
<br />
(LINUX) https://dl.google.com/android/repository/tools_r25.2.5-linux.zip<br />
<br />
------<br />
<br />
=== 1.5 Install Java ===<br />
You need the Java JDK<br />
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html<br />
<br />
------<br />
<br />
=== 1.6 (PC) Install Visual Studio ===<br />
https://www.visualstudio.com/downloads/<br />
<br />
Install [https://developer.microsoft.com/en-us/windows/downloads/windows-8-1-sdk Win 8.1 SDK]<br />
<br />
Install [https://marketplace.visualstudio.com/items?itemName=AdMediator.MicrosoftAdvertisingSDKforWindowsandWindowsPhone8x Microsoft Advertising SDK for Windows and Windows Phone 8.x]<br />
<br />
Ensure that you have MSBuild v12 or v14 installed (building with the makefile will fail with an incorrect version).<br />
<br />
------<br />
<br />
=== 1.7 (MAC) Install Xcode ===<br />
https://itunes.apple.com/fr/app/xcode/id497799835?mt=12<br />
<br />
------<br />
<br />
=== 1.8 (Mac) ensure xcode command line tools are working ===<br />
(MAC) Open a terminal window <br />
<syntaxhighlight lang="bash"><br />
sudo xCodebuild –license <br />
quit<br />
agree<br />
</syntaxhighlight><br />
<br /><br />
------<br />
<br />
=== 1.9 Install Python ===<br />
https://www.python.org/downloads/release/python-2712/<br />
<br />
You need Python 2.7.12 or later to install emscripten properly.<br />
<br />
Once installed, add it to your command line path, eg: c:\python27, on windows you can do this by right-clicking on 'myComputer' or 'This PC', go to 'Properties', click 'Advanced System Settings', Click 'Environmental Variables', double-click 'Path', add 'c:\python27'.<br />
<br />
------<br />
<br />
=== 1.10 Install emscripten ===<br />
http://kripken.github.io/emscripten-site/<br />
<br />
You need this is you want to build for HTML5 + Facebook games.<br />
<br />
Using a shell or MSYS2 (previously installed) on windows, go to your home or C: folder and type:<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/juj/emsdk.git<br />
</syntaxhighlight><br />
<br />
Once that has completed open a command prompt in that folder on Windows, on other system just cd to the folder.<br />
<br />
Using emsdk, install and activate all the latest packages:<br />
<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install latest<br />
emsdk activate latest<br />
</syntaxhighlight><br />
<br />
(PC) Type:<br />
<syntaxhighlight lang="bash"><br />
emsdk_env.bat<br />
</syntaxhighlight><br />
<br />
(MAC) Type:<br />
<syntaxhighlight lang="bash"><br />
source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
To use incoming branch of emscripten, use these commands instead:<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install sdk-incoming-64bit<br />
emsdk activate sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
To further use Gideros own git fork of emscripten:<br />
<syntaxhighlight lang="bash"><br />
cd emscripten/incoming<br />
# Add a git remote link to your own repository.<br />
git remote add gideros https://github.com/gideros/emscripten.git<br />
# Obtain the changes in your link.<br />
git fetch gideros<br />
# Switch the emscripten-incoming tool to use your fork.<br />
git checkout -b gideros_incoming --track gideros/incoming<br />
#Get back to emscripten directory and rebuild<br />
cd ../..<br />
emsdk install sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
<br />
These can also be installed within emsdk: git, crunch, and spidermonkey<br />
<syntaxhighlight lang="bash"><br />
(on non-PC put ./ before emsdk)<br />
emsdk install git-1.9.4<br />
emsdk install crunch-1.03<br />
emsdk install spidermonkey-37.0.1-64bit<br />
emsdk activate git-1.9.4<br />
emsdk activate crunch-1.03<br />
emsdk activate spidermonkey-37.0.1-64bit<br />
(PC) emsdk_env.bat<br />
(MAC) source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
(PC) Make sure the environment variable EM_CONFIG is set to the location of your emscripten config file.<br />
<br />
The emscripten build also needs the CMake command. You can download it and extract it to your home or C: folder. Don't forget to add it's path to the end of the EMSDKPATH in Makefile.def.<br />
<br />
https://cmake.org/download/<br />
<br />
------<br />
<br />
=== 1.11 Install Steam SDK ===<br />
https://partner.steamgames.com/?goto=%2Fdownloads%2Fsteamworks_sdk.zip<br />
<br />
Extract the archive/zip file to your home or C: folder, for example if the file is called 'steamworks_sdk_142.zip' then you will have a 'c:\steamworks_sdk_142' folder with a solder called 'sdk' within it. The sdk folder contains other folders such as glmgr, public, tools, etc.<br />
<br />
This is necessary for the Steam plugin.<br />
<br />
------<br />
<br />
=== 1.12 Install Gideros ===<br />
<br />
==== 1.12.1 Fetch gideros source code ====<br />
(PC) Open MSYS2 32 bit shell<br />
<br />
(MAC/Linux) Open a terminal<br />
<br />
Navigate to the folder where you into to work.<br />
<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/gideros/gideros <br />
</syntaxhighlight><br />
<br />
==== 1.12.2 Configure scripts ====<br />
Make a copy of the file gideros/scripts/Makefile.def.example, rename it to Makefile.def and update the file copy according <br />
to your installation. Ensure that the QT\_ARCH and QT_TOOLSARCH paths are formatted correctly according to your Qt <br />
install directory structure (see below that they are named differently by Qt).<br />
<br />
''''''Example:''''''<br />
<br/><br />
'''On PC:'''<br />
<br />
For Qt:<syntaxhighlight lang="bash>QTBASEDIR=/c/Qt<br />
QT_ARCH=mingw53_32<br />
QT_TOOLSARCH=mingw530_32<br />
QTVER=5.9.1<br />
QT5ICUVER=59<br />
<br />
STEAMSDK=/c/Applications/steamworks_sdk_142<br />
export STEAMSDK<br />
</syntaxhighlight><br />
<br/><br />
For Android:<br />
<br />
<syntaxhighlight lang="bash"><br />
# on Windows, also add this to PATH<br />
NDK_HOME=/c/android/android-ndk-r17b<br />
NDKBUILD=cmd //c /c/android/android-ndk-r17b/ndk-build.cmd<br />
#We use windows syntax for this one, as it will be used by gradle.bat script<br />
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144<br />
#Windows syntax with quadruple backslashs!<br />
ANDROID_HOME=C:\\\\Users\\\\Gideros\\\\AppData\\\\Local\\\\Android\\\\sdk<br />
<br />
</syntaxhighlight><br />
<br/><br />
For WinRT:<br />
<br />
<syntaxhighlight lang="bash"><br />
FXC="/c/Program Files (x86)/Windows Kits/8.1/bin/x86/fxc.exe" <br />
MSBUILD="/c/Program Files (x86)/MSBuild/14.0/Bin/MSbuild.exe" <br />
</syntaxhighlight><br />
<br/><br />
<br />
For html5:<br />
<br />
<syntaxhighlight lang="bash"><br />
EMSDK=/c/emsdkwin<br />
EMSDKPATH=$(EMSDK):$(EMSDK)/clang/e1.35.0_64bit:$(EMSDK)/node/4.1.1_64bit/bin:$(EMSDK)/python/2.7.5.3_64bit:$(EMSDK)/emscripten/1.35.0<br />
EMSDK_PREFIX=PATH=$(EMSDKPATH):$$$$PATH cmd //c<br />
CRUNCHME=crunchme-win32.exe<br />
</syntaxhighlight><br />
<br/><br />
'''On MAC:''' <br />
<br />
<syntaxhighlight lang="bash"><br />
QTBASEDIR=~/Qt QT_ARCH=clang_64 <br />
QT_TOOLSARCH=clang_64 <br />
QTVER=5.8 <br />
QT5ICUVER=54 #deprecated stuff <br />
</syntaxhighlight><br />
<br />
==== 1.12.3 Complete working example Makefile.def for Windows ====<br />
<br />
Here is a working example, you will have to change the filename details to match your setup:<br />
<br />
[[Example Makefile.def file|example Makefile.def file]].<br />
<br />
==== 1.12.4 Fetch additional repositories ====<br />
<br />
Go into just cloned gideros source folder and run make prep.repo<br />
<syntaxhighlight lang="bash"><br />
cd gideros<br />
make -f scripts/Makefile.gid prep.repo <br />
</syntaxhighlight><br />
<br />
If you intend to build the studio, you'll need scintilla and Lexilla libraries. Compile them now with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid qlexilla<br />
make -f scripts/Makefile.gid qscintilla<br />
</syntaxhighlight><br />
<br />
------<br />
<br />
== 2. Building ==<br />
<br />
If you have all dependencies in place for all targets, you can build everything at once via MSYS2 or Terminal with:<br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid<br />
</pre><br />
<br />
=== 2.1 Compilation on PC :===<br />
<br />
Open MSYS2 shell (msys2_shell.cmd). Standard compilation is 32 bit so use a 32 bit shell. Make sure you have installed the necessary build tools in MSYS2 using pacman, as detailed in [[#1.2 (PC) Install MSYS2 Console|Install MSYS2 Console]].<br />
.<br />
<br />
Navigate to gideros folder <br />
<br />
==== 2.1.1 Build QT tools : ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid qtapp.install<br />
</pre><br />
<br />
-> files GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in Build.Win folder <br />
<br />
==== 2.1.2 Android: ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid android.install <br />
</pre><br />
<br />
= file GiderosAndroidPlayer.apk in folder Build.Win/Players <br />
<br />
==== 2.1.3 winRT: ====<br />
<br />
''If necessary :''<br />
Open the solution, gideros/winRT_example/giderosgame.sln in Visual Studio. Check that the SQLite version for Windows and Windows Phone is up to date. Save and close the solution. <br />
<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid winrt.install <br />
</pre><br />
<br />
= file _bundle.appxupload in folder Build.Win/Players/WinRT<br />
<br />
==== 2.1.4 win32: ====<br />
<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid win32.install <br />
</pre><br />
<br />
= files in folder Build.Win/Templates/win32 <br />
<br />
==== 2.1.5 Html5: ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid html5.install<br />
</pre><br />
<br />
-> files in folders Build.Win//Players/Html5 and Build.Win/Templates/Html5<br />
<br />
==== 2.1.6 Plugins: ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid bundle.win <br />
</pre><br />
<br />
= folder bin and file gplugin in folder Build.Win/All Plugins<br />
<br />
==== 2.1.7 To build everything that can be built on Windows ====<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid all<br />
</syntaxhighlight><br />
<br />
Then you need to copy all the plugins to the 'Build.Win' folder with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid bundle.win<br />
</syntaxhighlight><br />
<br />
=== 2.2 Compilation on Mac :===<br />
Open Terminal. <br />
<br />
cd to the folder « gideros » <br />
<br />
==== 2.2.1 QT : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid qtapp.install <br />
</pre><br />
<br />
= GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in folder Build.Mac <br />
<br />
==== 2.2.2 iOS : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid ios.install <br />
</pre><br />
<br />
= GiderosiOSPlayer.zip in folder Buid.Mac/Players <br />
<br />
==== 2.2.3 Plugins: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid bundle.mac <br />
</pre><br />
<br />
= folders bin and files gplugin in folder Buid.Mac/All Plugins<br />
<br />
------<br />
<br />
== 3. Cleaning ==<br />
<br />
If you want to reset the build process and start again then you can issue a 'clean' command. To do this type 'make -f scripts/Makefile.gid clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid clean<br />
</syntaxhighlight><br />
<br />
<br />
Sometimes you need to make a clean a particular build. To do this type 'make -f scripts/Makefile.gid ' followed by something like 'html5' then '.clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid html5.clean<br />
</syntaxhighlight></div>Hgy29https://wiki.gideros.rocks/index.php?title=Compiling_Gideros_Source&diff=22469Compiling Gideros Source2023-08-17T09:04:11Z<p>Hgy29: /* 1.3.1 (Linux/Debian) Install Git, build-tools */</p>
<hr />
<div>The following instructions are for developers who want to contribute to or otherwise experiment with the Gideros C/C++ engine and are ''not'' necessary for either building or deploying apps made with Gideros.<br />
<br />
The Gideros project consists of the Gideros Studio IDE, the Gideros SDK libraries, Gideros Texture Packer, Gideros Font Creator, "players" or export templates for all the platforms Gideros supports, all targets of all plugins, a daemon and a bridge. The build system is flexible, so you only need the tools for the targets you are interested in deploying to with Qt (and MSYS2 on Windows) being a realistic minimum.<br />
<br />
<div class="noautonum">__TOC__</div><br />
<br />
== 1. Requirements ==<br />
=== 1.1 Install QT ===<br />
https://www.qt.io/download-open-source/<br />
<br />
Recommended version 6.3 with MinGW <br /><br />
<br />
Double click on the downloaded file and follow instructions. When installing, expand the tree view and ensure you have ticked the MinGW child option of the Qt version checkbox, as well as the MinGW option in the Tools section.<br />
Beside main QT package, you'll need the following additional components:<br />
* WebSocket additional library<br />
* Multimedia additional library<br />
* Qt5 Compatibility addon<br />
<br />
(MAC) Move the created folder into your user account folder <br />
<br />
(LINUX) Depending on your distribution, you may need to install qt5 websocket lib seperately (sudo apt-get install libqt5websockets5-dev)<br />
<br />
------<br />
<br />
===1.2 (PC) Install MSYS2 Console===<br />
https://msys2.github.io/ <br />
<br />
Double click on the downloaded file (msys2-i686) and follow instructions. <br />
<br />
Open 32 bit MSYS2 shell: msys2_shell.cmd<br />
<syntaxhighlight lang="bash"><br />
pacman –Sy pacman<br />
pacman –Syu<br />
pacman –Su<br />
pacman –S tar<br />
pacman –S zip<br />
pacman –S unzip<br />
pacman –S git<br />
pacman –S base-devel<br />
pacman -S python<br />
#For compiling win32/32bit under a MinGW64<br />
pacman -S mingw-w64-i686-toolchain<br />
pacman -S mingw-w64-i686-glew<br />
pacman -S mingw-w64-i686-curl<br />
pacman -S mingw-w64-i686-libpng<br />
#For compiling win32/64bit under a MinGW64<br />
pacman -S mingw-w64-x86_64-toolchain<br />
pacman -S mingw-w64-x86_64-glew<br />
pacman -S mingw-w64-x86_64-curl<br />
pacman -S mingw-w64-x86_64-libpng<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.3 (Mac) Install Git & xcpretty ===<br />
http://git-scm.com/downloads<br />
<br />
Ctrl + right click, open with « Install program.app » Follow instructions keeping default values as they are. <br />
<br />
(MAC) open a terminal window <br />
<syntaxhighlight lang="bash"><br />
git config –global user.name "your git login" <br />
git config –global user.email "your git email"<br />
sudo gem install xcpretty<br />
</syntaxhighlight><br />
------<br />
=== 1.3.1 (Linux/Debian) Install Git, build-tools ===<br />
<syntaxhighlight lang="bash"><br />
apt install git build-essential libxcb-xinerama0 libgl1-mesa-dev libz-dev<br />
git config --global user.email "your git email"<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.4 (PC) Android requirements ===<br />
<br />
==== 1.4.1 Install Android Studio and NDK ====<br />
<br />
https://developer.android.com/studio/index.html<br />
https://developer.android.com/ndk/downloads/older_releases.html<br />
<br />
Recommended NDK is 17b (the x86_64 version)<br />
<br />
Once downloaded, copy the contents of the NDK to your home or C: folder, rename the folder that you copied to 'android-ndk', for example you will end up with 'c:\android-ndk' and below that folders that say build, meta, platforms, etc.<br />
<br />
==== 1.4.2 Install Ant (no longer required but kept util someone confirms this)====<br />
https://ant.apache.org/<br />
<br />
Once downloaded, copy the contents of the install archive/zip file to your home folder or C: drive.<br />
Eg: so you have a folder called c:\apache-ant-1.10.5 with bin, etc, lib, manual folders within that.<br />
<br />
==== 1.4.3 Mix Old and New Tools (no longer required but kept util someone confirms this) ====<br />
<br />
Gideros uses Ant to build the player, unfortunately the tools to support Ant are now missing from the latest Android tools.<br />
<br />
<br />
There is a fix for this:<br />
<br />
# Rename the existing 'tools' folder in the Android SDK folder to 'tools_new'.<br />
# Download an older (March 2016) version of the tools and copy that folder to the Android SDK folder.<br />
# Copy the contents of 'tools_new' over the contents of 'tools'.<br />
<br />
Here is where you can download the compatible set of tools from:<br />
<br />
(PC) https://dl.google.com/android/repository/tools_r25.2.5-windows.zip<br />
<br />
(MAC) https://dl.google.com/android/repository/tools_r25.2.5-macosx.zip<br />
<br />
(LINUX) https://dl.google.com/android/repository/tools_r25.2.5-linux.zip<br />
<br />
------<br />
<br />
=== 1.5 Install Java ===<br />
You need the Java JDK<br />
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html<br />
<br />
------<br />
<br />
=== 1.6 (PC) Install Visual Studio ===<br />
https://www.visualstudio.com/downloads/<br />
<br />
Install [https://developer.microsoft.com/en-us/windows/downloads/windows-8-1-sdk Win 8.1 SDK]<br />
<br />
Install [https://marketplace.visualstudio.com/items?itemName=AdMediator.MicrosoftAdvertisingSDKforWindowsandWindowsPhone8x Microsoft Advertising SDK for Windows and Windows Phone 8.x]<br />
<br />
Ensure that you have MSBuild v12 or v14 installed (building with the makefile will fail with an incorrect version).<br />
<br />
------<br />
<br />
=== 1.7 (MAC) Install Xcode ===<br />
https://itunes.apple.com/fr/app/xcode/id497799835?mt=12<br />
<br />
------<br />
<br />
=== 1.8 (Mac) ensure xcode command line tools are working ===<br />
(MAC) Open a terminal window <br />
<syntaxhighlight lang="bash"><br />
sudo xCodebuild –license <br />
quit<br />
agree<br />
</syntaxhighlight><br />
<br /><br />
------<br />
<br />
=== 1.9 Install Python ===<br />
https://www.python.org/downloads/release/python-2712/<br />
<br />
You need Python 2.7.12 or later to install emscripten properly.<br />
<br />
Once installed, add it to your command line path, eg: c:\python27, on windows you can do this by right-clicking on 'myComputer' or 'This PC', go to 'Properties', click 'Advanced System Settings', Click 'Environmental Variables', double-click 'Path', add 'c:\python27'.<br />
<br />
------<br />
<br />
=== 1.10 Install emscripten ===<br />
http://kripken.github.io/emscripten-site/<br />
<br />
You need this is you want to build for HTML5 + Facebook games.<br />
<br />
Using a shell or MSYS2 (previously installed) on windows, go to your home or C: folder and type:<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/juj/emsdk.git<br />
</syntaxhighlight><br />
<br />
Once that has completed open a command prompt in that folder on Windows, on other system just cd to the folder.<br />
<br />
Using emsdk, install and activate all the latest packages:<br />
<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install latest<br />
emsdk activate latest<br />
</syntaxhighlight><br />
<br />
(PC) Type:<br />
<syntaxhighlight lang="bash"><br />
emsdk_env.bat<br />
</syntaxhighlight><br />
<br />
(MAC) Type:<br />
<syntaxhighlight lang="bash"><br />
source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
To use incoming branch of emscripten, use these commands instead:<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install sdk-incoming-64bit<br />
emsdk activate sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
To further use Gideros own git fork of emscripten:<br />
<syntaxhighlight lang="bash"><br />
cd emscripten/incoming<br />
# Add a git remote link to your own repository.<br />
git remote add gideros https://github.com/gideros/emscripten.git<br />
# Obtain the changes in your link.<br />
git fetch gideros<br />
# Switch the emscripten-incoming tool to use your fork.<br />
git checkout -b gideros_incoming --track gideros/incoming<br />
#Get back to emscripten directory and rebuild<br />
cd ../..<br />
emsdk install sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
<br />
These can also be installed within emsdk: git, crunch, and spidermonkey<br />
<syntaxhighlight lang="bash"><br />
(on non-PC put ./ before emsdk)<br />
emsdk install git-1.9.4<br />
emsdk install crunch-1.03<br />
emsdk install spidermonkey-37.0.1-64bit<br />
emsdk activate git-1.9.4<br />
emsdk activate crunch-1.03<br />
emsdk activate spidermonkey-37.0.1-64bit<br />
(PC) emsdk_env.bat<br />
(MAC) source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
(PC) Make sure the environment variable EM_CONFIG is set to the location of your emscripten config file.<br />
<br />
The emscripten build also needs the CMake command. You can download it and extract it to your home or C: folder. Don't forget to add it's path to the end of the EMSDKPATH in Makefile.def.<br />
<br />
https://cmake.org/download/<br />
<br />
------<br />
<br />
=== 1.11 Install Steam SDK ===<br />
https://partner.steamgames.com/?goto=%2Fdownloads%2Fsteamworks_sdk.zip<br />
<br />
Extract the archive/zip file to your home or C: folder, for example if the file is called 'steamworks_sdk_142.zip' then you will have a 'c:\steamworks_sdk_142' folder with a solder called 'sdk' within it. The sdk folder contains other folders such as glmgr, public, tools, etc.<br />
<br />
This is necessary for the Steam plugin.<br />
<br />
------<br />
<br />
=== 1.12 Install Gideros ===<br />
<br />
==== 1.12.1 Fetch gideros source code ====<br />
(PC) Open MSYS2 32 bit shell<br />
<br />
(MAC/Linux) Open a terminal<br />
<br />
Navigate to the folder where you into to work.<br />
<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/gideros/gideros <br />
</syntaxhighlight><br />
<br />
==== 1.12.2 Configure scripts ====<br />
Make a copy of the file gideros/scripts/Makefile.def.example, rename it to Makefile.def and update the file copy according <br />
to your installation. Ensure that the QT\_ARCH and QT_TOOLSARCH paths are formatted correctly according to your Qt <br />
install directory structure (see below that they are named differently by Qt).<br />
<br />
''''''Example:''''''<br />
<br/><br />
'''On PC:'''<br />
<br />
For Qt:<syntaxhighlight lang="bash>QTBASEDIR=/c/Qt<br />
QT_ARCH=mingw53_32<br />
QT_TOOLSARCH=mingw530_32<br />
QTVER=5.9.1<br />
QT5ICUVER=59<br />
<br />
STEAMSDK=/c/Applications/steamworks_sdk_142<br />
export STEAMSDK<br />
</syntaxhighlight><br />
<br/><br />
For Android:<br />
<br />
<syntaxhighlight lang="bash"><br />
# on Windows, also add this to PATH<br />
NDK_HOME=/c/android/android-ndk-r17b<br />
NDKBUILD=cmd //c /c/android/android-ndk-r17b/ndk-build.cmd<br />
#We use windows syntax for this one, as it will be used by gradle.bat script<br />
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144<br />
#Windows syntax with quadruple backslashs!<br />
ANDROID_HOME=C:\\\\Users\\\\Gideros\\\\AppData\\\\Local\\\\Android\\\\sdk<br />
<br />
</syntaxhighlight><br />
<br/><br />
For WinRT:<br />
<br />
<syntaxhighlight lang="bash"><br />
FXC="/c/Program Files (x86)/Windows Kits/8.1/bin/x86/fxc.exe" <br />
MSBUILD="/c/Program Files (x86)/MSBuild/14.0/Bin/MSbuild.exe" <br />
</syntaxhighlight><br />
<br/><br />
<br />
For html5:<br />
<br />
<syntaxhighlight lang="bash"><br />
EMSDK=/c/emsdkwin<br />
EMSDKPATH=$(EMSDK):$(EMSDK)/clang/e1.35.0_64bit:$(EMSDK)/node/4.1.1_64bit/bin:$(EMSDK)/python/2.7.5.3_64bit:$(EMSDK)/emscripten/1.35.0<br />
EMSDK_PREFIX=PATH=$(EMSDKPATH):$$$$PATH cmd //c<br />
CRUNCHME=crunchme-win32.exe<br />
</syntaxhighlight><br />
<br/><br />
'''On MAC:''' <br />
<br />
<syntaxhighlight lang="bash"><br />
QTBASEDIR=~/Qt QT_ARCH=clang_64 <br />
QT_TOOLSARCH=clang_64 <br />
QTVER=5.8 <br />
QT5ICUVER=54 #deprecated stuff <br />
</syntaxhighlight><br />
<br />
==== 1.12.3 Complete working example Makefile.def for Windows ====<br />
<br />
Here is a working example, you will have to change the filename details to match your setup:<br />
<br />
[[Example Makefile.def file|example Makefile.def file]].<br />
<br />
==== 1.12.4 Fetch additional repositories ====<br />
<br />
Go into just cloned gideros source folder and run make prep.repo<br />
<syntaxhighlight lang="bash"><br />
cd gideros<br />
make -f scripts/Makefile.gid prep.repo <br />
</syntaxhighlight><br />
<br />
If you intend to build the studio, you'll need scintilla and Lexilla libraries. Compile them now with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid qlexilla<br />
make -f scripts/Makefile.gid qscintilla<br />
</syntaxhighlight><br />
<br />
------<br />
<br />
== 2. Building ==<br />
<br />
If you have all dependencies in place for all targets, you can build everything at once via MSYS2 or Terminal with:<br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid<br />
</pre><br />
<br />
=== 2.1 Compilation on PC :===<br />
<br />
Open MSYS2 shell (msys2_shell.cmd). Standard compilation is 32 bit so use a 32 bit shell. Make sure you have installed the necessary build tools in MSYS2 using pacman, as detailed in [[#1.2 (PC) Install MSYS2 Console|Install MSYS2 Console]].<br />
.<br />
<br />
Navigate to gideros folder <br />
<br />
==== 2.1.1 Build QT tools : ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid qtapp.install<br />
</pre><br />
<br />
-> files GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in Build.Win folder <br />
<br />
==== 2.1.2 Android: ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid android.install <br />
</pre><br />
<br />
= file GiderosAndroidPlayer.apk in folder Build.Win/Players <br />
<br />
==== 2.1.3 winRT: ====<br />
<br />
''If necessary :''<br />
Open the solution, gideros/winRT_example/giderosgame.sln in Visual Studio. Check that the SQLite version for Windows and Windows Phone is up to date. Save and close the solution. <br />
<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid winrt.install <br />
</pre><br />
<br />
= file _bundle.appxupload in folder Build.Win/Players/WinRT<br />
<br />
==== 2.1.4 win32: ====<br />
<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid win32.install <br />
</pre><br />
<br />
= files in folder Build.Win/Templates/win32 <br />
<br />
==== 2.1.5 Html5: ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid html5.install<br />
</pre><br />
<br />
-> files in folders Build.Win//Players/Html5 and Build.Win/Templates/Html5<br />
<br />
==== 2.1.6 Plugins: ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid bundle.win <br />
</pre><br />
<br />
= folder bin and file gplugin in folder Build.Win/All Plugins<br />
<br />
==== 2.1.7 To build everything that can be built on Windows ====<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid all<br />
</syntaxhighlight><br />
<br />
Then you need to copy all the plugins to the 'Build.Win' folder with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid bundle.win<br />
</syntaxhighlight><br />
<br />
=== 2.2 Compilation on Mac :===<br />
Open Terminal. <br />
<br />
cd to the folder « gideros » <br />
<br />
==== 2.2.1 QT : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid qtapp.install <br />
</pre><br />
<br />
= GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in folder Build.Mac <br />
<br />
==== 2.2.2 iOS : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid ios.install <br />
</pre><br />
<br />
= GiderosiOSPlayer.zip in folder Buid.Mac/Players <br />
<br />
==== 2.2.3 Plugins: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid bundle.mac <br />
</pre><br />
<br />
= folders bin and files gplugin in folder Buid.Mac/All Plugins<br />
<br />
------<br />
<br />
== 3. Cleaning ==<br />
<br />
If you want to reset the build process and start again then you can issue a 'clean' command. To do this type 'make -f scripts/Makefile.gid clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid clean<br />
</syntaxhighlight><br />
<br />
<br />
Sometimes you need to make a clean a particular build. To do this type 'make -f scripts/Makefile.gid ' followed by something like 'html5' then '.clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid html5.clean<br />
</syntaxhighlight></div>Hgy29https://wiki.gideros.rocks/index.php?title=Compiling_Gideros_Source&diff=22468Compiling Gideros Source2023-08-17T08:53:03Z<p>Hgy29: /* 1.1 Install QT */</p>
<hr />
<div>The following instructions are for developers who want to contribute to or otherwise experiment with the Gideros C/C++ engine and are ''not'' necessary for either building or deploying apps made with Gideros.<br />
<br />
The Gideros project consists of the Gideros Studio IDE, the Gideros SDK libraries, Gideros Texture Packer, Gideros Font Creator, "players" or export templates for all the platforms Gideros supports, all targets of all plugins, a daemon and a bridge. The build system is flexible, so you only need the tools for the targets you are interested in deploying to with Qt (and MSYS2 on Windows) being a realistic minimum.<br />
<br />
<div class="noautonum">__TOC__</div><br />
<br />
== 1. Requirements ==<br />
=== 1.1 Install QT ===<br />
https://www.qt.io/download-open-source/<br />
<br />
Recommended version 6.3 with MinGW <br /><br />
<br />
Double click on the downloaded file and follow instructions. When installing, expand the tree view and ensure you have ticked the MinGW child option of the Qt version checkbox, as well as the MinGW option in the Tools section.<br />
Beside main QT package, you'll need the following additional components:<br />
* WebSocket additional library<br />
* Multimedia additional library<br />
* Qt5 Compatibility addon<br />
<br />
(MAC) Move the created folder into your user account folder <br />
<br />
(LINUX) Depending on your distribution, you may need to install qt5 websocket lib seperately (sudo apt-get install libqt5websockets5-dev)<br />
<br />
------<br />
<br />
===1.2 (PC) Install MSYS2 Console===<br />
https://msys2.github.io/ <br />
<br />
Double click on the downloaded file (msys2-i686) and follow instructions. <br />
<br />
Open 32 bit MSYS2 shell: msys2_shell.cmd<br />
<syntaxhighlight lang="bash"><br />
pacman –Sy pacman<br />
pacman –Syu<br />
pacman –Su<br />
pacman –S tar<br />
pacman –S zip<br />
pacman –S unzip<br />
pacman –S git<br />
pacman –S base-devel<br />
pacman -S python<br />
#For compiling win32/32bit under a MinGW64<br />
pacman -S mingw-w64-i686-toolchain<br />
pacman -S mingw-w64-i686-glew<br />
pacman -S mingw-w64-i686-curl<br />
pacman -S mingw-w64-i686-libpng<br />
#For compiling win32/64bit under a MinGW64<br />
pacman -S mingw-w64-x86_64-toolchain<br />
pacman -S mingw-w64-x86_64-glew<br />
pacman -S mingw-w64-x86_64-curl<br />
pacman -S mingw-w64-x86_64-libpng<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.3 (Mac) Install Git & xcpretty ===<br />
http://git-scm.com/downloads<br />
<br />
Ctrl + right click, open with « Install program.app » Follow instructions keeping default values as they are. <br />
<br />
(MAC) open a terminal window <br />
<syntaxhighlight lang="bash"><br />
git config –global user.name "your git login" <br />
git config –global user.email "your git email"<br />
sudo gem install xcpretty<br />
</syntaxhighlight><br />
------<br />
=== 1.3.1 (Linux/Debian) Install Git, build-tools ===<br />
<syntaxhighlight lang="bash"><br />
apt install git build-essential libxcb-xinerama0 libgl1-mesa-dev libz-dev<br />
git config –global user.email "your git email"<br />
</syntaxhighlight><br />
------<br />
<br />
=== 1.4 (PC) Android requirements ===<br />
<br />
==== 1.4.1 Install Android Studio and NDK ====<br />
<br />
https://developer.android.com/studio/index.html<br />
https://developer.android.com/ndk/downloads/older_releases.html<br />
<br />
Recommended NDK is 17b (the x86_64 version)<br />
<br />
Once downloaded, copy the contents of the NDK to your home or C: folder, rename the folder that you copied to 'android-ndk', for example you will end up with 'c:\android-ndk' and below that folders that say build, meta, platforms, etc.<br />
<br />
==== 1.4.2 Install Ant (no longer required but kept util someone confirms this)====<br />
https://ant.apache.org/<br />
<br />
Once downloaded, copy the contents of the install archive/zip file to your home folder or C: drive.<br />
Eg: so you have a folder called c:\apache-ant-1.10.5 with bin, etc, lib, manual folders within that.<br />
<br />
==== 1.4.3 Mix Old and New Tools (no longer required but kept util someone confirms this) ====<br />
<br />
Gideros uses Ant to build the player, unfortunately the tools to support Ant are now missing from the latest Android tools.<br />
<br />
<br />
There is a fix for this:<br />
<br />
# Rename the existing 'tools' folder in the Android SDK folder to 'tools_new'.<br />
# Download an older (March 2016) version of the tools and copy that folder to the Android SDK folder.<br />
# Copy the contents of 'tools_new' over the contents of 'tools'.<br />
<br />
Here is where you can download the compatible set of tools from:<br />
<br />
(PC) https://dl.google.com/android/repository/tools_r25.2.5-windows.zip<br />
<br />
(MAC) https://dl.google.com/android/repository/tools_r25.2.5-macosx.zip<br />
<br />
(LINUX) https://dl.google.com/android/repository/tools_r25.2.5-linux.zip<br />
<br />
------<br />
<br />
=== 1.5 Install Java ===<br />
You need the Java JDK<br />
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html<br />
<br />
------<br />
<br />
=== 1.6 (PC) Install Visual Studio ===<br />
https://www.visualstudio.com/downloads/<br />
<br />
Install [https://developer.microsoft.com/en-us/windows/downloads/windows-8-1-sdk Win 8.1 SDK]<br />
<br />
Install [https://marketplace.visualstudio.com/items?itemName=AdMediator.MicrosoftAdvertisingSDKforWindowsandWindowsPhone8x Microsoft Advertising SDK for Windows and Windows Phone 8.x]<br />
<br />
Ensure that you have MSBuild v12 or v14 installed (building with the makefile will fail with an incorrect version).<br />
<br />
------<br />
<br />
=== 1.7 (MAC) Install Xcode ===<br />
https://itunes.apple.com/fr/app/xcode/id497799835?mt=12<br />
<br />
------<br />
<br />
=== 1.8 (Mac) ensure xcode command line tools are working ===<br />
(MAC) Open a terminal window <br />
<syntaxhighlight lang="bash"><br />
sudo xCodebuild –license <br />
quit<br />
agree<br />
</syntaxhighlight><br />
<br /><br />
------<br />
<br />
=== 1.9 Install Python ===<br />
https://www.python.org/downloads/release/python-2712/<br />
<br />
You need Python 2.7.12 or later to install emscripten properly.<br />
<br />
Once installed, add it to your command line path, eg: c:\python27, on windows you can do this by right-clicking on 'myComputer' or 'This PC', go to 'Properties', click 'Advanced System Settings', Click 'Environmental Variables', double-click 'Path', add 'c:\python27'.<br />
<br />
------<br />
<br />
=== 1.10 Install emscripten ===<br />
http://kripken.github.io/emscripten-site/<br />
<br />
You need this is you want to build for HTML5 + Facebook games.<br />
<br />
Using a shell or MSYS2 (previously installed) on windows, go to your home or C: folder and type:<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/juj/emsdk.git<br />
</syntaxhighlight><br />
<br />
Once that has completed open a command prompt in that folder on Windows, on other system just cd to the folder.<br />
<br />
Using emsdk, install and activate all the latest packages:<br />
<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install latest<br />
emsdk activate latest<br />
</syntaxhighlight><br />
<br />
(PC) Type:<br />
<syntaxhighlight lang="bash"><br />
emsdk_env.bat<br />
</syntaxhighlight><br />
<br />
(MAC) Type:<br />
<syntaxhighlight lang="bash"><br />
source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
To use incoming branch of emscripten, use these commands instead:<br />
<syntaxhighlight lang="bash"><br />
#(on non-PC put ./ before emsdk)<br />
emsdk install sdk-incoming-64bit<br />
emsdk activate sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
To further use Gideros own git fork of emscripten:<br />
<syntaxhighlight lang="bash"><br />
cd emscripten/incoming<br />
# Add a git remote link to your own repository.<br />
git remote add gideros https://github.com/gideros/emscripten.git<br />
# Obtain the changes in your link.<br />
git fetch gideros<br />
# Switch the emscripten-incoming tool to use your fork.<br />
git checkout -b gideros_incoming --track gideros/incoming<br />
#Get back to emscripten directory and rebuild<br />
cd ../..<br />
emsdk install sdk-incoming-64bit<br />
</syntaxhighlight><br />
<br />
<br />
These can also be installed within emsdk: git, crunch, and spidermonkey<br />
<syntaxhighlight lang="bash"><br />
(on non-PC put ./ before emsdk)<br />
emsdk install git-1.9.4<br />
emsdk install crunch-1.03<br />
emsdk install spidermonkey-37.0.1-64bit<br />
emsdk activate git-1.9.4<br />
emsdk activate crunch-1.03<br />
emsdk activate spidermonkey-37.0.1-64bit<br />
(PC) emsdk_env.bat<br />
(MAC) source ./emsdk_env.sh<br />
</syntaxhighlight><br />
<br />
(PC) Make sure the environment variable EM_CONFIG is set to the location of your emscripten config file.<br />
<br />
The emscripten build also needs the CMake command. You can download it and extract it to your home or C: folder. Don't forget to add it's path to the end of the EMSDKPATH in Makefile.def.<br />
<br />
https://cmake.org/download/<br />
<br />
------<br />
<br />
=== 1.11 Install Steam SDK ===<br />
https://partner.steamgames.com/?goto=%2Fdownloads%2Fsteamworks_sdk.zip<br />
<br />
Extract the archive/zip file to your home or C: folder, for example if the file is called 'steamworks_sdk_142.zip' then you will have a 'c:\steamworks_sdk_142' folder with a solder called 'sdk' within it. The sdk folder contains other folders such as glmgr, public, tools, etc.<br />
<br />
This is necessary for the Steam plugin.<br />
<br />
------<br />
<br />
=== 1.12 Install Gideros ===<br />
<br />
==== 1.12.1 Fetch gideros source code ====<br />
(PC) Open MSYS2 32 bit shell<br />
<br />
(MAC/Linux) Open a terminal<br />
<br />
Navigate to the folder where you into to work.<br />
<br />
<syntaxhighlight lang="bash"><br />
git clone https://github.com/gideros/gideros <br />
</syntaxhighlight><br />
<br />
==== 1.12.2 Configure scripts ====<br />
Make a copy of the file gideros/scripts/Makefile.def.example, rename it to Makefile.def and update the file copy according <br />
to your installation. Ensure that the QT\_ARCH and QT_TOOLSARCH paths are formatted correctly according to your Qt <br />
install directory structure (see below that they are named differently by Qt).<br />
<br />
''''''Example:''''''<br />
<br/><br />
'''On PC:'''<br />
<br />
For Qt:<syntaxhighlight lang="bash>QTBASEDIR=/c/Qt<br />
QT_ARCH=mingw53_32<br />
QT_TOOLSARCH=mingw530_32<br />
QTVER=5.9.1<br />
QT5ICUVER=59<br />
<br />
STEAMSDK=/c/Applications/steamworks_sdk_142<br />
export STEAMSDK<br />
</syntaxhighlight><br />
<br/><br />
For Android:<br />
<br />
<syntaxhighlight lang="bash"><br />
# on Windows, also add this to PATH<br />
NDK_HOME=/c/android/android-ndk-r17b<br />
NDKBUILD=cmd //c /c/android/android-ndk-r17b/ndk-build.cmd<br />
#We use windows syntax for this one, as it will be used by gradle.bat script<br />
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144<br />
#Windows syntax with quadruple backslashs!<br />
ANDROID_HOME=C:\\\\Users\\\\Gideros\\\\AppData\\\\Local\\\\Android\\\\sdk<br />
<br />
</syntaxhighlight><br />
<br/><br />
For WinRT:<br />
<br />
<syntaxhighlight lang="bash"><br />
FXC="/c/Program Files (x86)/Windows Kits/8.1/bin/x86/fxc.exe" <br />
MSBUILD="/c/Program Files (x86)/MSBuild/14.0/Bin/MSbuild.exe" <br />
</syntaxhighlight><br />
<br/><br />
<br />
For html5:<br />
<br />
<syntaxhighlight lang="bash"><br />
EMSDK=/c/emsdkwin<br />
EMSDKPATH=$(EMSDK):$(EMSDK)/clang/e1.35.0_64bit:$(EMSDK)/node/4.1.1_64bit/bin:$(EMSDK)/python/2.7.5.3_64bit:$(EMSDK)/emscripten/1.35.0<br />
EMSDK_PREFIX=PATH=$(EMSDKPATH):$$$$PATH cmd //c<br />
CRUNCHME=crunchme-win32.exe<br />
</syntaxhighlight><br />
<br/><br />
'''On MAC:''' <br />
<br />
<syntaxhighlight lang="bash"><br />
QTBASEDIR=~/Qt QT_ARCH=clang_64 <br />
QT_TOOLSARCH=clang_64 <br />
QTVER=5.8 <br />
QT5ICUVER=54 #deprecated stuff <br />
</syntaxhighlight><br />
<br />
==== 1.12.3 Complete working example Makefile.def for Windows ====<br />
<br />
Here is a working example, you will have to change the filename details to match your setup:<br />
<br />
[[Example Makefile.def file|example Makefile.def file]].<br />
<br />
==== 1.12.4 Fetch additional repositories ====<br />
<br />
Go into just cloned gideros source folder and run make prep.repo<br />
<syntaxhighlight lang="bash"><br />
cd gideros<br />
make -f scripts/Makefile.gid prep.repo <br />
</syntaxhighlight><br />
<br />
If you intend to build the studio, you'll need scintilla and Lexilla libraries. Compile them now with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid qlexilla<br />
make -f scripts/Makefile.gid qscintilla<br />
</syntaxhighlight><br />
<br />
------<br />
<br />
== 2. Building ==<br />
<br />
If you have all dependencies in place for all targets, you can build everything at once via MSYS2 or Terminal with:<br />
<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid<br />
</pre><br />
<br />
=== 2.1 Compilation on PC :===<br />
<br />
Open MSYS2 shell (msys2_shell.cmd). Standard compilation is 32 bit so use a 32 bit shell. Make sure you have installed the necessary build tools in MSYS2 using pacman, as detailed in [[#1.2 (PC) Install MSYS2 Console|Install MSYS2 Console]].<br />
.<br />
<br />
Navigate to gideros folder <br />
<br />
==== 2.1.1 Build QT tools : ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid qtapp.install<br />
</pre><br />
<br />
-> files GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in Build.Win folder <br />
<br />
==== 2.1.2 Android: ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid android.install <br />
</pre><br />
<br />
= file GiderosAndroidPlayer.apk in folder Build.Win/Players <br />
<br />
==== 2.1.3 winRT: ====<br />
<br />
''If necessary :''<br />
Open the solution, gideros/winRT_example/giderosgame.sln in Visual Studio. Check that the SQLite version for Windows and Windows Phone is up to date. Save and close the solution. <br />
<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid winrt.install <br />
</pre><br />
<br />
= file _bundle.appxupload in folder Build.Win/Players/WinRT<br />
<br />
==== 2.1.4 win32: ====<br />
<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid win32.install <br />
</pre><br />
<br />
= files in folder Build.Win/Templates/win32 <br />
<br />
==== 2.1.5 Html5: ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid html5.install<br />
</pre><br />
<br />
-> files in folders Build.Win//Players/Html5 and Build.Win/Templates/Html5<br />
<br />
==== 2.1.6 Plugins: ====<br />
<pre lang="bash"><br />
make –f scripts/Makefile.gid bundle.win <br />
</pre><br />
<br />
= folder bin and file gplugin in folder Build.Win/All Plugins<br />
<br />
==== 2.1.7 To build everything that can be built on Windows ====<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid all<br />
</syntaxhighlight><br />
<br />
Then you need to copy all the plugins to the 'Build.Win' folder with:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid bundle.win<br />
</syntaxhighlight><br />
<br />
=== 2.2 Compilation on Mac :===<br />
Open Terminal. <br />
<br />
cd to the folder « gideros » <br />
<br />
==== 2.2.1 QT : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid qtapp.install <br />
</pre><br />
<br />
= GiderosStudio.exe, GiderosPlayer.exe, GiderosTexturePacker.exe (…) in folder Build.Mac <br />
<br />
==== 2.2.2 iOS : ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid ios.install <br />
</pre><br />
<br />
= GiderosiOSPlayer.zip in folder Buid.Mac/Players <br />
<br />
==== 2.2.3 Plugins: ====<br />
<pre lang="bash"><br />
make -f scripts/Makefile.gid bundle.mac <br />
</pre><br />
<br />
= folders bin and files gplugin in folder Buid.Mac/All Plugins<br />
<br />
------<br />
<br />
== 3. Cleaning ==<br />
<br />
If you want to reset the build process and start again then you can issue a 'clean' command. To do this type 'make -f scripts/Makefile.gid clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid clean<br />
</syntaxhighlight><br />
<br />
<br />
Sometimes you need to make a clean a particular build. To do this type 'make -f scripts/Makefile.gid ' followed by something like 'html5' then '.clean'.<br />
<br />
eg:<br />
<syntaxhighlight lang="bash"><br />
make -f scripts/Makefile.gid html5.clean<br />
</syntaxhighlight></div>Hgy29https://wiki.gideros.rocks/index.php?title=Timer.new&diff=22460Timer.new2023-07-13T13:33:54Z<p>Hgy29: Text replacement - "</source>" to "</syntaxhighlight>"</p>
<hr />
<div>__NOTOC__<br />
<languages /><br />
'''<translate>Available since</translate>:''' Gideros 2011.6<br/><br />
'''<translate>Class</translate>:''' [[Special:MyLanguage/Timer|Timer]]<br/><br />
=== <translate>Description</translate> ===<br />
<translate><br /><br />
Creates a new [[Special:MyLanguage/Timer|Timer]] object with the specified delay and repeatCount states.<br /><br />
<br /></translate><br />
<syntaxhighlight lang="lua"><br />
Timer.new(delay,repeatCount)<br />
</syntaxhighlight><br />
=== <translate>Parameters</translate> ===<br />
'''delay''': (any) <translate>The time interval between timer events in milliseconds.</translate> <br/><br />
'''repeatCount''': <translate>The number of repetitions. A value of 0 runs the timer infinitely. If nonzero, the timer runs the specified number of times and then stops.</translate> <br/><br />
<br />
{{Timer}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=SpineSprite:stopAnimation&diff=22459SpineSprite:stopAnimation2023-07-13T13:33:54Z<p>Hgy29: Text replacement - "</source>" to "</syntaxhighlight>"</p>
<hr />
<div>__NOTOC__<br />
<languages /><br />
'''<translate>Available since</translate>:''' Gideros 2018.12<br/><br />
'''<translate>Class</translate>:''' [[Special:MyLanguage/Spine|SpineSprite]]<br/><br />
=== <translate>Description</translate> ===<br />
<translate>Remove all animations on the specified track</translate><br />
<syntaxhighlight lang="lua"><br />
SpineSprite:stopAnimation(track,mix)<br />
</syntaxhighlight><br />
=== <translate>Parameters</translate> ===<br />
'''track''': (integer) <translate>Track</translate><br/><br />
'''mix''': (number) <translate>Mix duration</translate><br/></div>Hgy29https://wiki.gideros.rocks/index.php?title=Tostring&diff=22458Tostring2023-07-13T13:33:54Z<p>Hgy29: Text replacement - "</source>" to "</syntaxhighlight>"</p>
<hr />
<div>__NOTOC__<br />
'''Available since:''' Gideros 2011.6<br/><br />
'''Class:''' [[(global)]]<br/><br />
<br />
=== Description ===<br />
Receives an argument of any type and converts it to a string in a reasonable format.<br />
<syntaxhighlight lang="lua"><br />
(string) = tostring(e)<br />
</syntaxhighlight><br />
<br />
For complete control of how numbers are converted, use string.format.<br />
<br />
If the ''metatable'' of ''e'' has a "__tostring" field, then '''tostring''' calls the corresponding value with ''e'' as argument, and uses the result of the call as its result.<br />
<br />
=== Parameters ===<br />
'''e''': (any) value to convert to string<br/><br />
<br />
=== Return values ===<br />
'''Returns''' (string) value converted to string or nil<br/><br />
<br />
{{(global)}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Sprite:redrawEffects&diff=22457Sprite:redrawEffects2023-07-13T13:33:54Z<p>Hgy29: Text replacement - "</source>" to "</syntaxhighlight>"</p>
<hr />
<div>__NOTOC__<br />
'''Available since:''' Gideros 2021.1<br/><br />
'''Class:''' [[Sprite]]<br/><br />
<br />
=== Description ===<br />
Tell Gideros effects should be updated for this sprite. This is relevant if effect mode was set to something else than [[Sprite.EFFECT_MODE_CONTINUOUS]] in [[Sprite:setEffectStack]].<br />
<syntaxhighlight lang="lua"><br />
Sprite:redrawEffects()<br />
</syntaxhighlight><br />
<br />
{{Sprite}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=TextInputDialog:isSecureInput&diff=22456TextInputDialog:isSecureInput2023-07-13T13:33:54Z<p>Hgy29: Text replacement - "</source>" to "</syntaxhighlight>"</p>
<hr />
<div>__NOTOC__<br />
<languages /><br />
'''<translate>Available since</translate>:''' Gideros 2012.8<br/><br />
'''<translate>Class</translate>:''' [[Special:MyLanguage/TextInputDialog|TextInputDialog]]<br/><br />
=== <translate>Description</translate> ===<br />
<translate><br /><br />
Returns whether the text object hides the text being entered.<br /><br />
<br /></translate><br />
<syntaxhighlight lang="lua"><br />
(bool) = TextInputDialog:isSecureInput()<br />
</syntaxhighlight><br />
=== <translate>Return values</translate> ===<br />
'''<translate>Returns</translate>''' (bool) <translate>Whether the text object hides the text being entered.</translate><br/><br />
<br />
{{TextInputDialog}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=TextField&diff=22455TextField2023-07-13T13:33:54Z<p>Hgy29: Text replacement - "</source>" to "</syntaxhighlight>"</p>
<hr />
<div>__NOTOC__<br />
<!-- GIDEROSOBJ:TextField --><br />
'''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/><br />
'''Available since:''' Gideros 2011.6<br/><br />
'''Inherits from:''' [[Sprite]]<br/><br />
<br />
=== Description ===<br />
The '''TextField''' class is used to create objects for text display.<br />
<br />
=== Examples ===<br />
'''Example 1:''' bitmap font:<br />
<syntaxhighlight lang="lua"><br />
local font = Font.new("myfont.txt", "myfont.png") -- you need to add your bitmap font<br />
local textfield = TextField.new(font, "some text")<br />
stage:addChild(textfield)<br />
textfield:setText("some other text") -- change the text<br />
</syntaxhighlight><br />
<br />
'''Example 2:''' default font:<br />
<syntaxhighlight lang="lua"><br />
-- to use the default font, pass nil value for the font parameter<br />
local textfield2 = TextField.new(nil, "some text with default font")<br />
stage:addChild(textfield2)<br />
</syntaxhighlight><br />
<br />
'''Example 3:''' TTFont:<br />
<syntaxhighlight lang="lua"><br />
local font = TTFont.new("fonts/Tahoma.ttf", 32, "", true, 1) -- you need to add your .ttf font<br />
local text = TextField.new(font, "This is a text")<br />
text:setPosition(100, 100)<br />
stage:addChild(text)<br />
</syntaxhighlight><br />
<br />
'''Example 4:''' colored text:<br />
<syntaxhighlight lang="lua"><br />
local text = TextField.new(nil, "This is a \e[color=#f005]semi transparent red\e[color] text")<br />
text:setPosition(32, 64)<br />
stage:addChild(text)<br />
</syntaxhighlight><br />
<br />
=== See also ===<br />
'''[[CompositeFont]]'''<br />
<br />
{|-<br />
| style="width: 50%; vertical-align:top;"|<br />
=== Methods ===<br />
[[TextField.new]] ''creates a new TextField object with the specified font and text''<br/><!--GIDEROSMTD:TextField.new(font,text,sample,layout) creates a new TextField object with the specified font and text--><br />
[[TextField:getLayout]] ''retrieves the layout parameters of the Textfield''<br/><!--GIDEROSMTD:TextField:getLayout() retrieves the layout parameters of the Textfield--><br />
[[TextField:getLetterSpacing]] ''returns the letter-spacing property which is used to increase or decrease the space between characters in a text''<br/><!--GIDEROSMTD:TextField:getLetterSpacing() returns the letter-spacing property which is used to increase or decrease the space between characters in a text--><br />
[[TextField:getLineHeight]] ''gets the textfield line height''<br/><!--GIDEROSMTD:TextField:getLineHeight() gets the textfield line height--><br />
[[TextField:getPointFromTextPosition]] ''returns the coordinates from a given offset within the text''<br/><!--GIDEROSMTD:TextField:getPointFromTextPosition(offset) returns the coordinates from a given offset within the text--><br />
[[TextField:getSample]] ''gets the string used as sample for determining line height''<br/><!--GIDEROSMTD:TextField:getSample() gets the string used as sample for determining line height--><br />
[[TextField:getText]] ''returns the textfield text''<br/><!-- GIDEROSMTD:TextField:getText() returns the textfield text--><br />
[[TextField:getTextColor]] ''returns the textfield text color in hexadecimal format''<br/><!--GIDEROSMTD:TextField:getTextColor() returns the textfield text color in hexadecimal format--><br />
[[TextField:getTextPositionFromPoint]] ''returns the offset into a text from x,y coordinates''<br/><!--GIDEROSMTD:TextField:getTextPositionFromPoint(x,y) returns the offset into a text from x,y coordinates--><br />
[[TextField:setFont]] ''sets the textfield font to use''<br/><!--GIDEROSMTD:TextField:setFont(font) sets the textfield font to use--><br />
[[TextField:setLayout]] ''changes the textfield layout parameters''<br/><!--GIDEROSMTD:TextField:setLayout(layout) changes the textfield layout parameters--><br />
[[TextField:setLetterSpacing]] ''sets the letter-spacing property which is used to increase or decrease the space between characters in a text''<br/><!-- GIDEROSMTD:TextField:setLetterSpacing(spacing) sets the letter-spacing property which is used to increase or decrease the space between characters in a text--><br />
[[TextField:setSample]] ''sets the sample string used for determining the text line height''<br/><!--GIDEROSMTD:TextField:setSample(sample) sets the sample string used for determining the text line height--><br />
[[TextField:setText]] ''sets the textfield text to be displayed''<br/><!--GIDEROSMTD:TextField:setText(text) sets the textfield text to be displayed--><br />
[[TextField:setTextColor]] ''sets the textfield text color in hexadecimal format''<br/><!--GIDEROSMTD:TextField:setTextColor(color) sets the textfield text color in hexadecimal format--><br />
<br />
| style="width: 50%; vertical-align:top;"|<br />
=== Events ===<br />
=== Constants ===<br />
|}<br />
<br />
{{GIDEROS IMPORTANT LINKS}}</div>Hgy29https://wiki.gideros.rocks/index.php?title=Table.getn&diff=22454Table.getn2023-07-13T13:33:54Z<p>Hgy29: Text replacement - "</source>" to "</syntaxhighlight>"</p>
<hr />
<div>__NOTOC__<br />
'''Available since:''' Gideros 2011.6<br/><br />
'''Class:''' [[Special:MyLanguage/table|table]]<br/><br />
<br />
=== Description ===<br />
Returns the size of the table, or n field, or table.setn value, or 1 less first index with nil value.<br />
<br />
'''[Deprecated in Lua 5.1, use # operator]'''<br />
<br />
<syntaxhighlight lang="lua"><br />
table.getn(table)<br />
</syntaxhighlight><br />
<br />
=== Parameters ===<br />
'''table''': (any) <br/><br />
<br />
{{Table}}</div>Hgy29