mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Fix a bug with regenerating the tilemap object
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<windowWidth>800</windowWidth>
|
||||
<windowHeight>600</windowHeight>
|
||||
<latestCompilationDirectory></latestCompilationDirectory>
|
||||
<maxFPS>60</maxFPS>
|
||||
<maxFPS>-1</maxFPS>
|
||||
<minFPS>10</minFPS>
|
||||
<verticalSync>false</verticalSync>
|
||||
<extensions>
|
||||
@@ -709,6 +709,33 @@
|
||||
</actions>
|
||||
<events />
|
||||
</event>
|
||||
<event disabled="false" folded="false">
|
||||
<type>BuiltinCommonInstructions::Standard</type>
|
||||
<conditions>
|
||||
<condition>
|
||||
<type inverted="false" value="SourisBouton" />
|
||||
<parameters>
|
||||
<parameter></parameter>
|
||||
<parameter>Left</parameter>
|
||||
</parameters>
|
||||
<subConditions />
|
||||
</condition>
|
||||
</conditions>
|
||||
<actions>
|
||||
<action>
|
||||
<type inverted="false" value="TileMapObject::SetTile" />
|
||||
<parameters>
|
||||
<parameter>Platforms</parameter>
|
||||
<parameter>2</parameter>
|
||||
<parameter>Platforms.GetColumnAt(MouseX())</parameter>
|
||||
<parameter>Platforms.GetRowAt(MouseY())</parameter>
|
||||
<parameter>0</parameter>
|
||||
</parameters>
|
||||
<subActions />
|
||||
</action>
|
||||
</actions>
|
||||
<events />
|
||||
</event>
|
||||
</events>
|
||||
<layers>
|
||||
<layer name="" visibility="true">
|
||||
|
@@ -133,7 +133,7 @@ void DeclareTileMapObjectExtension(gd::PlatformExtension & extension)
|
||||
.AddParameter("expression", _("Tile layer (0: Back, 1: Middle, 2: Top)"))
|
||||
.AddParameter("expression", _("Tile column"))
|
||||
.AddParameter("expression", _("Tile row"))
|
||||
.AddParameter("expression", _("New tile Id"))
|
||||
.AddParameter("expression", _("New tile Id (-1 to delete the tile)"))
|
||||
.MarkAsSimple()
|
||||
.codeExtraInformation.SetFunctionName("SetTile").SetIncludeFile("TileMapObject/RuntimeTileMapObject.h");
|
||||
|
||||
|
@@ -77,6 +77,10 @@ bool RuntimeTileMapObject::Draw( sf::RenderTarget& window )
|
||||
//Re-generate the vertex array and the hitboxes
|
||||
vertexArray = TileMapExtension::GenerateVertexArray(tileSet.Get(), tileMap.Get());
|
||||
hitboxes = TileMapExtension::GenerateHitboxes(tileSet.Get(), tileMap.Get());
|
||||
for(std::vector<Polygon2d>::iterator it = hitboxes.begin(); it != hitboxes.end(); it++)
|
||||
{
|
||||
it->Move(GetX(), GetY());
|
||||
}
|
||||
needGeneration = false;
|
||||
}
|
||||
|
||||
|
@@ -49,8 +49,8 @@ class TileMapObjectEditor: public TileMapObjectEditorBase
|
||||
virtual ~TileMapObjectEditor();
|
||||
|
||||
protected:
|
||||
virtual void OnClearLayerToolClicked(wxCommandEvent& event);
|
||||
virtual void OnFillLayerToolClicked(wxCommandEvent& event);
|
||||
virtual void OnClearLayerToolClicked(wxCommandEvent& event);
|
||||
virtual void OnFillLayerToolClicked(wxCommandEvent& event);
|
||||
virtual void OnTileInsertionModeChanged(wxCommandEvent& event);
|
||||
virtual void OnCloseButtonClicked(wxCloseEvent& event);
|
||||
virtual void OnHelpButtonClicked(wxHyperlinkEvent& event);
|
||||
|
Reference in New Issue
Block a user