Skip to content

Commit

Permalink
update docs & tags for v1.16
Browse files Browse the repository at this point in the history
  • Loading branch information
mfessenden committed Sep 21, 2017
1 parent 4444fc5 commit 11da652
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 19 deletions.
3 changes: 1 addition & 2 deletions Demo/SKTiledDemoScene.swift
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ extension SKTiledDemoScene {
// add a tile shape to the base layer where the user has clicked

// highlight the current coordinate
let tile = addTileToWorld(Int(coord.x), Int(coord.y), role: .coordinate)
let _ = addTileToWorld(Int(coord.x), Int(coord.y), role: .highlight)

// update the tile information label
let coordStr = "Coord: \(coord.shortDescription), \(positionInLayer.roundTo())"
Expand Down Expand Up @@ -886,7 +886,6 @@ extension SKTiledDemoScene {
*/
override public func sceneDoubleTapped(location: CGPoint) {
log("scene was double tapped.", level: .debug)
//self.isPaused = !self.isPaused
}
#else

Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
**SKTiled** is a framework for using [Tiled][tiled-url] assets with [Apple's SpriteKit][spritekit-url], built from the ground up with Swift. This project began life as an exercise to learn Apple's new programming language for a game project, but I've decided to release it as open source with the hopes that others will find it useful. **SKTiled** is up-to-date and supports **Tiled's** major features, including all map & object types.


Current release is Swift 3/macOS 10.11/iOS 10+. For Swift 4/Xcode 9, see the [**swift4**][swift4-url] branch.
Current release is Swift 3.2/macOS 10.11/iOS 10+. For Swift 4, see the [**swift4**][swift4-url] branch.


![Demo Image][demo-image]
Expand Down Expand Up @@ -45,7 +45,7 @@ Check out the [Official Documentation](https://mfessenden.github.io/SKTiled).

- iOS 9+
- macOS 10.12+
- Xcode 8+
- Xcode 9+

## Installation

Expand Down Expand Up @@ -200,7 +200,7 @@ let roadRoot = SKNode()
groundLayer.addChild(roadRoot, 4, 5, zpos: 100.0)
```

**SKTiled** also provides methods for getting coordinate data from `UITouch` and `NSEvent` mouse events:
**SKTiled** also provides methods for getting coordinate data from [`UITouch`][uitouch-url] and [`NSEvent`][nsevent-url] mouse events:

```swift
// get the coordinate at the location of a touch event
Expand All @@ -223,7 +223,7 @@ for tile in allAnimated {

// run animation backwards
for tile in allAnimated {
tile = -1.0
tile.speed = -1.0
}

// get animated tiles from individual layers
Expand Down Expand Up @@ -266,7 +266,7 @@ let allWalkable = tilemap.getTilesWithProperty("walkable", true")
- [Clint Bellanger: Isometric Tiles Math](http://clintbellanger.net/articles/isometric_math)
[swift-image]:https://img.shields.io/badge/Swift-3.1-brightgreen.svg
[swift-image]:https://img.shields.io/badge/Swift-3.2-brightgreen.svg
[swift-url]: https://swift.org/
[license-image]:https://img.shields.io/badge/License-MIT-blue.svg
[license-url]:https://github.com/mfessenden/SKTiled/blob/master/LICENSE
Expand Down Expand Up @@ -306,3 +306,5 @@ let allWalkable = tilemap.getTilesWithProperty("walkable", true")
[skspritenode-url]:https://developer.apple.com/documentation/spritekit/skspritenode
[skscene-url]:https://developer.apple.com/documentation/spritekit/skscene
[skscene-update-url]:https://developer.apple.com/documentation/spritekit/skscene/1519802-update
[uitouch-url]:https://developer.apple.com/documentation/uikit/uitouch
[nsevent-url]:https://developer.apple.com/documentation/appkit/nsevent
Binary file modified Resources/dungeon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Resources/isometric-130x66.tmx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" tiledversion="1.0.2" orientation="isometric" renderorder="right-down" width="10" height="10" tilewidth="130" tileheight="66" backgroundcolor="#634930" nextobjectid="18">
<map version="1.0" tiledversion="1.0.3" orientation="isometric" renderorder="right-down" width="10" height="10" tilewidth="130" tileheight="66" backgroundcolor="#634930" nextobjectid="18">
<properties>
<property name="worldScale" type="float" value="0.4"/>
</properties>
Expand Down
4 changes: 2 additions & 2 deletions Resources/roguelike-16x16.tmx
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
<ellipse/>
</object>
</objectgroup>
<layer name="Graph" width="42" height="42" visible="0">
<layer name="Graph" width="42" height="42" opacity="0.8">
<data encoding="base64" compression="zlib">
eJztl1EKAjEMRP3y/sdcbyF+LIRhJplkW0XYQtDdtsnrJJH6ej4er9tu+yP7jF8zdDh38x6LGM9RaZ2d5wCLa6ec2ZhyIq/i7OTO4ax8nnMHcDBNd3HiJ9ur2JiG3bzH+NXo9IbiZO9Xcjq+kCPyIBc+OzGcfLvnVbyshpVvpU+X03lX5SbjvNJHqlYmOar6qIrtcMZn/O4M5FQxrnCyfVc5q5rp5mkHZ+bPiYH5cPxNOF3fDudKRsa5s993clZx45xay9a4rBhP9bvDqZ6rmF3G2EfZGrcOos/s/jDlzHTq1Oqk5h3tmZ6urnENrp/cwVhcdZ+qrNI9nr3LxvxVv+2T3DNONTINWV5wz1VO5t/lZLqyHH6bE/PKtO32Y3euw5n5wzsSy4fLyeYVJ/vP0znHRMtMg5WmarfLqbSc+HDvbmy+yzq5f50xqr2oq1ufinOSB+RkDOi3qofVerqcnTr4Fuduuzlvzl9xvgE4egCv
eJztl1EKwzAMQ/u1+x+zu8XYR8EIyZbdZmXQgNm6JPaLbJfs/dq292OP/ZF9x90MHc7VvPtFjMeotM7Os4PFtVPObEw5kVdxdnLncFY+j7kdOJimqzjxk+1VbEzDbt5j/Gp0euPQTrGv4nR8IUfkQS58dmI4+XbPq3hZDSvfSp8up/NblZuM80wfqVqZ5Kjqoyq2wxmf8bszkFPFOMPJ9p3lrGqmm6cVnJk/Jwbmw/E34XR9O5xXMjLOlf2+krOKG+fUWrbGZcV4qt8dTvVcxewyxj7K1rh1EH1m94cpZ6ZTp1YnNe9oz/R0dY1rcP3kDsbiqvtUZZXu8exdNuaverdPcs841cg0ZHnBPWc5mX+Xk+nKcvhrTswr07bbj925DmfmD+9ILB8uJ5tXnOw/T+ccEy0zDa40VbtdTqXlxId7d2PzXdbJ/euIUe1FXd36VJyTPCAnY0C/VT1crafL2amDX3Gutofz4byL8wMKo/+y
</data>
</layer>
</map>
2 changes: 1 addition & 1 deletion Resources/roguelike-16x16.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@
<tile id="1767">
<properties>
<property name="walkable" type="bool" value="true"/>
<property name="weight" type="float" value="-5"/>
<property name="weight" type="float" value="1"/>
</properties>
</tile>
<tile id="1768">
Expand Down
3 changes: 1 addition & 2 deletions Sources/SKTile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -614,15 +614,14 @@ open class SKTile: SKSpriteNode, Loggable {
let frame = frames[currentFrame]
if let frameTexture = frame.texture {
self.texture = frameTexture
// update sprite size
self.size = frameTexture.size()
}
}

// the the current time is greater than the animation cycle, reset current time to 0
if ct >= cycleTime { currentTime = 0 }
}


}


Expand Down
2 changes: 1 addition & 1 deletion Sources/SKTiled+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1909,7 +1909,7 @@ internal func clampedPosition(point: CGPoint, scale: CGFloat) -> CGPoint {
- parameter scale: `CGFloat` device scale.
*/
internal func clampPositionWithNode(node: SKNode, scale: CGFloat) {
node.position = clampedPosition(point: node.position, scale: SKTiledContentScaleFactor)
node.position = clampedPosition(point: node.position, scale: scale)
if let parentNode = node.parent {
if parentNode != node.scene {
clampPositionWithNode(node: parentNode, scale: scale)
Expand Down
11 changes: 6 additions & 5 deletions iOS/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BV1-FR-VrT">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BV1-FR-VrT">
<device id="retina5_5" orientation="landscape">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -23,7 +24,7 @@
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="top" translatesAutoresizingMaskIntoConstraints="NO" id="Ex0-TE-FEH" userLabel="Bottom Controls">
<rect key="frame" x="163" y="313" width="410" height="85"/>
<subviews>
<stackView opaque="NO" contentMode="scaleAspectFill" distribution="equalSpacing" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="QyX-Za-Z1p" userLabel="Buttons View">
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="QyX-Za-Z1p" userLabel="Buttons View">
<rect key="frame" x="0.0" y="0.0" width="410" height="22"/>
<subviews>
<button opaque="NO" contentMode="center" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="lBL-VH-9cm" userLabel="Fit Button">
Expand Down Expand Up @@ -136,7 +137,7 @@
</constraints>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="o8A-1P-WNU" userLabel="Camera Info Label">
<rect key="frame" x="344.33333333333331" y="32" width="47.333333333333371" height="12"/>
<rect key="frame" x="344.33333333333331" y="12" width="47.333333333333371" height="12"/>
<attributedString key="attributedText">
<fragment content="Camera:">
<attributes>
Expand All @@ -151,7 +152,7 @@
<size key="shadowOffset" width="1" height="1"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aWk-BV-bvy" userLabel="Pause Info Label">
<rect key="frame" x="347.66666666666669" y="52" width="40.666666666666629" height="12"/>
<rect key="frame" x="347.66666666666669" y="32" width="40.666666666666629" height="12"/>
<attributedString key="attributedText">
<fragment content="Paused">
<attributes>
Expand Down
2 changes: 2 additions & 0 deletions macOS/GameViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class GameViewController: NSViewController, Loggable {
cameraInfoLabel.stringValue = "--"
debugInfoLabel.stringValue = ""
isolatedInfoLabel.stringValue = ""
coordinateInfoLabel.stringValue = ""

// text shadow
let shadow = NSShadow()
Expand All @@ -110,6 +111,7 @@ class GameViewController: NSViewController, Loggable {
cameraInfoLabel.shadow = shadow
pauseInfoLabel.shadow = shadow
isolatedInfoLabel.shadow = shadow
coordinateInfoLabel.shadow = shadow
}

/**
Expand Down

0 comments on commit 11da652

Please sign in to comment.