New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for defining gm views with objects #1621

Merged
merged 4 commits into from Jun 23, 2017

Conversation

Projects
None yet
2 participants
@willt
Contributor

willt commented Jun 22, 2017

Okay this adds the ability to define views in game maker by creating an object in tiled.
Set it to the size you want your view. Make sure x,y,width,height, etc are all Ints because thats what GM uses. Numbers will be rounded but that could lead to unexpected results.

If this looks good i can add some better docs and maybe some screen shots
Basically create an object set type to "view"
properties can be defined on the object the match gms properties like so:

igzo9iw

Views must be enabled in the map properties since this config comes before views are defined unless you can think of a better way of auto detecting them. I didn't want to iterate through the layers again just to find out if the views were defined. But we could?
Map Properties:
fq9h23d

@bjorn

bjorn requested changes Jun 22, 2017 edited

That looks much better than #1618!

Unfortunately the screenshot link http://i.imgur.com/iGZO9iw.png seems to be broken. Note that you can also upload the images to GitHub (I uploaded the second one).

Views must be enabled in the map properties since this config comes before views are defined unless you can think of a better way of auto detecting them. I didn't want to iterate through the layers again just to find out if the views were defined. But we could?

I think we should really just iterate the layers twice. It's not noticeable to the use, but needing to manually set another property to enable the views definitely is. :-)

See other comments inline.

Show outdated Hide outdated src/plugins/gmx/gmxplugin.cpp Outdated
Show outdated Hide outdated src/plugins/gmx/gmxplugin.cpp Outdated
Show outdated Hide outdated src/plugins/gmx/gmxplugin.cpp Outdated
Show outdated Hide outdated src/plugins/gmx/gmxplugin.cpp Outdated
refactored based on bjorns comments from #1621.
views are now enabled by default if a view is defined.
This can still be overridden by defining enableViews
false/true in map properties
@willt

This comment has been minimized.

Show comment
Hide comment
@willt

willt Jun 22, 2017

Contributor

Okay things are refactored. Much happier with enabling the views by default now. Just was worried about iterating too many times.
Some example images:
viewproperties
mapproperties

tiledviews

roomwithviewingm

runningingm

Contributor

willt commented Jun 22, 2017

Okay things are refactored. Much happier with enabling the views by default now. Just was worried about iterating too many times.
Some example images:
viewproperties
mapproperties

tiledviews

roomwithviewingm

runningingm

@bjorn

I just noticed the indentation was off in two places and the search for views could be aborted properly when a view is found. So just some minor changes and then I will merge this. Thanks a lot for your efforts!

Show outdated Hide outdated src/plugins/gmx/gmxplugin.cpp Outdated
Show outdated Hide outdated src/plugins/gmx/gmxplugin.cpp Outdated
Show outdated Hide outdated src/plugins/gmx/gmxplugin.cpp Outdated
@willt

This comment has been minimized.

Show comment
Hide comment
@willt

willt Jun 22, 2017

Contributor

Let me know if this works. Thanks for the feedback. strange i missed the indentation.

Contributor

willt commented Jun 22, 2017

Let me know if this works. Thanks for the feedback. strange i missed the indentation.

@bjorn

Just two more requests, sorry. :-)

Show outdated Hide outdated src/plugins/gmx/gmxplugin.cpp Outdated
Show outdated Hide outdated src/plugins/gmx/gmxplugin.cpp Outdated
moved checkIfViewsDefined to local static function
refactor checkIfViewsDefined to pass in map and
use local iterator instead of passing in iterator
@willt

This comment has been minimized.

Show comment
Hide comment
@willt

willt Jun 23, 2017

Contributor

No worries your feedback is most appreciated.

Contributor

willt commented Jun 23, 2017

No worries your feedback is most appreciated.

@bjorn bjorn merged commit abc5053 into bjorn:master Jun 23, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Jun 23, 2017

Owner

Looking good, thanks a lot for this improvement!

Owner

bjorn commented Jun 23, 2017

Looking good, thanks a lot for this improvement!

boaromayo added a commit to boaromayo/tiled that referenced this pull request Jun 28, 2017

Update forked repo (#1)
* Fixed crash when editing collision when tile image wasn't loaded

When opening a tileset it can happen that the tileset image fails to
load. In this case, opening the tile collision editor could lead to a
crash.

* GmxPlugin: Fixed tile type inheritance for tile objects

Now tile objects of which the tile has a type defined are exported as
instances of this type of object in the GameMaker room file.

* Added toolbar for stamp brush and bucket fill tool (bjorn#1586)

This adds a new tool-specific toolbar that can be used by tools.

Currently contains actions for rotating/flipping stamp and toggling random mode.

Closes bjorn#1084

* docs: Fixed link to other page

* QtPropertyBrowser: Removed deprecation warnings

The classes were deprecated in Qt 5.0 and warnings have been added in Qt
5.7.

* Fixed rendering of tile object outlines for resized objects

They were taking the size of the image instead of the size of the
object, which means this was broken since Tiled 0.12.

* Fixed rendering of tile objects when the image couldn't be loaded

If the tile was found but its image failed to load, tile objects would
not render at all and due to a broken boundingRect be also impossible to
interact with.

Now they render as the special "missing image marker" and can be
interacted with.

* More fixes for labels of objects nested in a group layer

* Fixed labels shown on objects hidden via a group layer
* Fixed updating of label visibility when toggling group layer visibility

* Fixed updating of label positions when moving a group layer

When moving a group layer, any labels present for objects nested within
that group layer need to be synchronized.

* GmxPlugin: Added support for defining views with objects (bjorn#1621)

* Fixed hang when trying to fill with a pasted stamp

Since 688ec7d the size of a copied map
is set to 0x0 instead of matching the tile layer's size. It was supposed
to be irrelevant, but as it turns out TileStamp::maxSize was based on
the size of the map instead of the size of the tile layer. This could
lead to an infinite loop in fillWithStamp in bucketfilltool.cpp.

Closes bjorn#1617
Closes bjorn#1624

* Restored Ctrl+N shortcut on "New Map" action

There isn't really a good reason not to have this shortcut. Eventually
it may pop up a dialog where you can pick what you want to create, but
since it's more common to create new maps than new tilesets we can just
do that for now.

* Use initializer list for quick-stamp keys

* Introduced TilesetDocumentsModel and its sort-filter model companion

This model lists the tileset documents that are currently open, and the
sort-filter version sorts them by name and filters out tilesets that are
embedded in other maps than the current one.

This model extracts part of the logic from TilesetDock, so that it could
be reused by an updated TerrainModel. The TerrainModel currently only
lists terrains from tilesets that are already part of the map, but it
should display all loaded external tilesets.

* libtiled-java: Fixed wrong exception being caught in TileSet (bjorn#1629)

* Display all tilesets with terrain in the Terrains view

Except for tilesets that are embedded into another map than the current
one, the Terrains view now displays all tilesets that have terrains
defined.

The Terrain Brush will now automatically add the tileset of the
currently selected terrain to the map when it isn't already present.

* Show custom properties on tiles and terrains in the map editor

While still not editable, this change shows these properties in a
read-only fashion. It is often useful to see them, as indicated by
multiple users on the forum.

* Bumped version to 1.0.2 and updated NEWS file

* Adds option to lock/unlock layer (bjorn#1627)

Locking a layer prevents modifications to the layer by the tools, as
well as by some actions like cut and delete. Modifications to objects
are prevented by making them not selectable.

Closes bjorn#734

* Fixed tool tips on flipping and rotating stamp actions

@boaromayo boaromayo referenced this pull request Aug 3, 2017

Closed

Update forked repo (#1) #1675

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment