//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// A SpriteKit node used to render a 2D array of textured sprites. Uses SKTileSet to determine what textures it can use to render. Separate tile map nodes can be layered on top of one another to achieve various effects, such as parallax scrolling.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/spritekit/sktilemapnode?language=objc)
#[unsafe(super(SKNode, NSResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
pub struct SKTileMapNode;
);
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSCoding for SKTileMapNode {}
);
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSCopying for SKTileMapNode {}
);
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
unsafe impl CopyingHelper for SKTileMapNode {
type Result = Self;
}
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSObjectProtocol for SKTileMapNode {}
);
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSSecureCoding for SKTileMapNode {}
);
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
impl SKTileMapNode {
extern_methods!(
#[cfg(all(feature = "SKTileSet", feature = "objc2-core-foundation"))]
/// Create a tile map node with the specified tile set and dimensions. The tiles of the map will be empty, equivalent to the nil tile definition/group.
///
/// Parameter `tileSet`: the tile set that is used to render the tiles
///
/// Parameter `columns`: the number of columns in the map that can hold tiles
///
/// Parameter `rows`: the number of rows in the map that can hold tiles
///
/// Parameter `tileSize`: the size of each tile in points
#[unsafe(method(tileMapNodeWithTileSet:columns:rows:tileSize:))]
#[unsafe(method_family = none)]
pub unsafe fn tileMapNodeWithTileSet_columns_rows_tileSize(
tile_set: &SKTileSet,
columns: NSUInteger,
rows: NSUInteger,
tile_size: CGSize,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(all(feature = "SKTileSet", feature = "objc2-core-foundation"))]
/// Create a tile map node with the specified tile set and dimensions, and fill it with the specified tile group.
///
/// Parameter `tileSet`: the tile set that is used to render the tiles
///
/// Parameter `columns`: the number of columns in the map that can hold tiles
///
/// Parameter `rows`: the number of rows in the map that can hold tiles
///
/// Parameter `tileSize`: the size of each tile in points
///
/// Parameter `tileGroup`: the tile group we wish to fill the tile map with
#[unsafe(method(tileMapNodeWithTileSet:columns:rows:tileSize:fillWithTileGroup:))]
#[unsafe(method_family = none)]
pub unsafe fn tileMapNodeWithTileSet_columns_rows_tileSize_fillWithTileGroup(
tile_set: &SKTileSet,
columns: NSUInteger,
rows: NSUInteger,
tile_size: CGSize,
tile_group: &SKTileGroup,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(all(feature = "SKTileSet", feature = "objc2-core-foundation"))]
/// Create a tile map node with the specified tile set and dimensions, and fill it with a specific layout of tile groups that belong to the provided tile set. The tileGroupLayout array should match the dimensions of the tile map (i.e., the number of elements should be equal to columns * rows). Index 0 of the array maps to column 0, row 0 of the tile map. Index 1 is column 1, row 0, and so on, wrapping around to the next row once the index passes the number of columns in the tile map. If the array has fewer elements than the number of tiles in the map, the remaining tiles are initialized with the nil tile group. If the array has more elements than the number of tiles in the map, the extra tile groups are ignored.
///
/// Parameter `tileSet`: the tile set that is used to render the tiles
///
/// Parameter `columns`: the number of columns in the map that can hold tiles
///
/// Parameter `rows`: the number of rows in the map that can hold tiles
///
/// Parameter `tileSize`: the size of each tile in points
///
/// Parameter `tileGroupLayout`: an array of tile groups that we want to use to fill the tile map
#[unsafe(method(tileMapNodeWithTileSet:columns:rows:tileSize:tileGroupLayout:))]
#[unsafe(method_family = none)]
pub unsafe fn tileMapNodeWithTileSet_columns_rows_tileSize_tileGroupLayout(
tile_set: &SKTileSet,
columns: NSUInteger,
rows: NSUInteger,
tile_size: CGSize,
tile_group_layout: &NSArray<SKTileGroup>,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(all(feature = "SKTileSet", feature = "objc2-core-foundation"))]
/// Initialize a tile map node with the specified tile set and dimensions. The tiles of the map will be empty, equivalent to the nil tile definition/group.
///
/// Parameter `tileSet`: the tile set that is used to render the tiles
///
/// Parameter `columns`: the number of columns in the map that can hold tiles
///
/// Parameter `rows`: the number of rows in the map that can hold tiles
///
/// Parameter `tileSize`: the size of each tile in points
#[unsafe(method(initWithTileSet:columns:rows:tileSize:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithTileSet_columns_rows_tileSize(
this: Allocated<Self>,
tile_set: &SKTileSet,
columns: NSUInteger,
rows: NSUInteger,
tile_size: CGSize,
) -> Retained<Self>;
#[cfg(all(feature = "SKTileSet", feature = "objc2-core-foundation"))]
/// Initialize a tile map node with the specified tile set and dimensions, and fill it with the specified tile group.
///
/// Parameter `tileSet`: the tile set that is used to render the tiles
///
/// Parameter `columns`: the number of columns in the map that can hold tiles
///
/// Parameter `rows`: the number of rows in the map that can hold tiles
///
/// Parameter `tileSize`: the size of each tile in points
///
/// Parameter `tileGroup`: the tile group we wish to fill the tile map with
#[unsafe(method(initWithTileSet:columns:rows:tileSize:fillWithTileGroup:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithTileSet_columns_rows_tileSize_fillWithTileGroup(
this: Allocated<Self>,
tile_set: &SKTileSet,
columns: NSUInteger,
rows: NSUInteger,
tile_size: CGSize,
tile_group: &SKTileGroup,
) -> Retained<Self>;
#[cfg(all(feature = "SKTileSet", feature = "objc2-core-foundation"))]
/// Initialize a tile map node with the specified tile set and dimensions, and fill it with a specific layout of tile groups that belong to the provided tile set. The tileGroupLayout array should match the dimensions of the tile map (i.e., the number of elements should be equal to columns * rows). Index 0 of the array maps to column 0, row 0 of the tile map. Index 1 is column 1, row 0, and so on, wrapping around to the next row once the index passes the number of columns in the tile map. If the array has fewer elements than the number of tiles in the map, the remaining tiles are initialized with the nil tile group. If the array has more elements than the number of tiles in the map, the extra tile groups are ignored.
///
/// Parameter `tileSet`: the tile set that is used to render the tiles
///
/// Parameter `columns`: the number of columns in the map that can hold tiles
///
/// Parameter `rows`: the number of rows in the map that can hold tiles
///
/// Parameter `tileSize`: the size of each tile in points
///
/// Parameter `tileGroupLayout`: an array of tile groups that we want to use to fill the tile map
#[unsafe(method(initWithTileSet:columns:rows:tileSize:tileGroupLayout:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithTileSet_columns_rows_tileSize_tileGroupLayout(
this: Allocated<Self>,
tile_set: &SKTileSet,
columns: NSUInteger,
rows: NSUInteger,
tile_size: CGSize,
tile_group_layout: &NSArray<SKTileGroup>,
) -> Retained<Self>;
/// The number of columns in the tile map.
#[unsafe(method(numberOfColumns))]
#[unsafe(method_family = none)]
pub unsafe fn numberOfColumns(&self) -> NSUInteger;
/// Setter for [`numberOfColumns`][Self::numberOfColumns].
#[unsafe(method(setNumberOfColumns:))]
#[unsafe(method_family = none)]
pub unsafe fn setNumberOfColumns(&self, number_of_columns: NSUInteger);
/// The number of rows in the tile map.
#[unsafe(method(numberOfRows))]
#[unsafe(method_family = none)]
pub unsafe fn numberOfRows(&self) -> NSUInteger;
/// Setter for [`numberOfRows`][Self::numberOfRows].
#[unsafe(method(setNumberOfRows:))]
#[unsafe(method_family = none)]
pub unsafe fn setNumberOfRows(&self, number_of_rows: NSUInteger);
#[cfg(feature = "objc2-core-foundation")]
/// The size of each tile in the map.
#[unsafe(method(tileSize))]
#[unsafe(method_family = none)]
pub unsafe fn tileSize(&self) -> CGSize;
#[cfg(feature = "objc2-core-foundation")]
/// Setter for [`tileSize`][Self::tileSize].
#[unsafe(method(setTileSize:))]
#[unsafe(method_family = none)]
pub unsafe fn setTileSize(&self, tile_size: CGSize);
#[cfg(feature = "objc2-core-foundation")]
/// The size of the tile map. This is dependent on the tileSize, the number of columns and rows in the map, and the tile set type.
#[unsafe(method(mapSize))]
#[unsafe(method_family = none)]
pub unsafe fn mapSize(&self) -> CGSize;
#[cfg(feature = "SKTileSet")]
/// The tile set being used by this tile map.
#[unsafe(method(tileSet))]
#[unsafe(method_family = none)]
pub unsafe fn tileSet(&self) -> Retained<SKTileSet>;
#[cfg(feature = "SKTileSet")]
/// Setter for [`tileSet`][Self::tileSet].
#[unsafe(method(setTileSet:))]
#[unsafe(method_family = none)]
pub unsafe fn setTileSet(&self, tile_set: &SKTileSet);
#[cfg(feature = "objc2-core-foundation")]
/// Controls the blending between the texture and the tile map color. The valid interval of values is from 0.0 up to and including 1.0. A value above or below that interval is clamped to the minimum (0.0) if below or the maximum (1.0) if above.
#[unsafe(method(colorBlendFactor))]
#[unsafe(method_family = none)]
pub unsafe fn colorBlendFactor(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
/// Setter for [`colorBlendFactor`][Self::colorBlendFactor].
#[unsafe(method(setColorBlendFactor:))]
#[unsafe(method_family = none)]
pub unsafe fn setColorBlendFactor(&self, color_blend_factor: CGFloat);
/// Base color for the tile map (If no texture is present, the color still is drawn).
#[unsafe(method(color))]
#[unsafe(method_family = none)]
pub unsafe fn color(&self) -> Retained<NSColor>;
/// Setter for [`color`][Self::color].
#[unsafe(method(setColor:))]
#[unsafe(method_family = none)]
pub unsafe fn setColor(&self, color: &NSColor);
/// Sets the blend mode to use when composing the tile map with the final framebuffer.
///
/// See: SKNode.SKBlendMode
#[unsafe(method(blendMode))]
#[unsafe(method_family = none)]
pub unsafe fn blendMode(&self) -> SKBlendMode;
/// Setter for [`blendMode`][Self::blendMode].
#[unsafe(method(setBlendMode:))]
#[unsafe(method_family = none)]
pub unsafe fn setBlendMode(&self, blend_mode: SKBlendMode);
#[cfg(feature = "objc2-core-foundation")]
/// Used to choose the location in the tile map that maps to its 'position' in the parent's coordinate space. The valid interval for each input is from 0.0 up to and including 1.0.
#[unsafe(method(anchorPoint))]
#[unsafe(method_family = none)]
pub unsafe fn anchorPoint(&self) -> CGPoint;
#[cfg(feature = "objc2-core-foundation")]
/// Setter for [`anchorPoint`][Self::anchorPoint].
#[unsafe(method(setAnchorPoint:))]
#[unsafe(method_family = none)]
pub unsafe fn setAnchorPoint(&self, anchor_point: CGPoint);
#[cfg(feature = "SKShader")]
/// A property that determines whether the tile map is rendered using a custom shader.
#[unsafe(method(shader))]
#[unsafe(method_family = none)]
pub unsafe fn shader(&self) -> Option<Retained<SKShader>>;
#[cfg(feature = "SKShader")]
/// Setter for [`shader`][Self::shader].
#[unsafe(method(setShader:))]
#[unsafe(method_family = none)]
pub unsafe fn setShader(&self, shader: Option<&SKShader>);
#[cfg(feature = "SKAttribute")]
/// Optional dictionary of SKAttributeValues
/// Attributes can be used with custom SKShaders.
#[unsafe(method(attributeValues))]
#[unsafe(method_family = none)]
pub unsafe fn attributeValues(&self) -> Retained<NSDictionary<NSString, SKAttributeValue>>;
#[cfg(feature = "SKAttribute")]
/// Setter for [`attributeValues`][Self::attributeValues].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setAttributeValues:))]
#[unsafe(method_family = none)]
pub unsafe fn setAttributeValues(
&self,
attribute_values: &NSDictionary<NSString, SKAttributeValue>,
);
#[cfg(feature = "SKAttribute")]
#[unsafe(method(valueForAttributeNamed:))]
#[unsafe(method_family = none)]
pub unsafe fn valueForAttributeNamed(
&self,
key: &NSString,
) -> Option<Retained<SKAttributeValue>>;
#[cfg(feature = "SKAttribute")]
#[unsafe(method(setValue:forAttributeNamed:))]
#[unsafe(method_family = none)]
pub unsafe fn setValue_forAttributeNamed(&self, value: &SKAttributeValue, key: &NSString);
/// Bitmask to indicate being lit by a set of lights using overlapping lighting categories.
///
/// A light whose category is set to a value that masks to non-zero using this mask will
/// apply light to this sprite.
///
/// When used together with a normal texture, complex lighting effects can be used.
#[unsafe(method(lightingBitMask))]
#[unsafe(method_family = none)]
pub unsafe fn lightingBitMask(&self) -> u32;
/// Setter for [`lightingBitMask`][Self::lightingBitMask].
#[unsafe(method(setLightingBitMask:))]
#[unsafe(method_family = none)]
pub unsafe fn setLightingBitMask(&self, lighting_bit_mask: u32);
#[unsafe(method(enableAutomapping))]
#[unsafe(method_family = none)]
pub unsafe fn enableAutomapping(&self) -> bool;
/// Setter for [`enableAutomapping`][Self::enableAutomapping].
#[unsafe(method(setEnableAutomapping:))]
#[unsafe(method_family = none)]
pub unsafe fn setEnableAutomapping(&self, enable_automapping: bool);
#[cfg(feature = "SKTileSet")]
/// Fill the entire tile map with the provided tile group.
///
/// Parameter `tileGroup`: the tile group that will be used to fill the map
#[unsafe(method(fillWithTileGroup:))]
#[unsafe(method_family = none)]
pub unsafe fn fillWithTileGroup(&self, tile_group: Option<&SKTileGroup>);
#[cfg(feature = "SKTileDefinition")]
/// Look up the tile definition at the specified tile index.
///
/// Parameter `column`: the column index of the tile
///
/// Parameter `row`: the row index of the tile
#[unsafe(method(tileDefinitionAtColumn:row:))]
#[unsafe(method_family = none)]
pub unsafe fn tileDefinitionAtColumn_row(
&self,
column: NSUInteger,
row: NSUInteger,
) -> Option<Retained<SKTileDefinition>>;
#[cfg(feature = "SKTileSet")]
/// Look up the tile group at the specified tile index.
///
/// Parameter `column`: the column index of the tile
///
/// Parameter `row`: the row index of the tile
#[unsafe(method(tileGroupAtColumn:row:))]
#[unsafe(method_family = none)]
pub unsafe fn tileGroupAtColumn_row(
&self,
column: NSUInteger,
row: NSUInteger,
) -> Option<Retained<SKTileGroup>>;
#[cfg(feature = "SKTileSet")]
/// Set the tile group at the specified tile index. When automapping is enabled, the appropriate tile definitions will automatically be selected and placed, possibly modifying neighboring tiles. When automapping is disabled, it will simply place the default center tile definition for the group, and will not modify any of the neihboring tiles.
///
/// Parameter `tileGroup`: the tile group we want to place in the map
///
/// Parameter `column`: the column index of the tile
///
/// Parameter `row`: the row index of the tile
#[unsafe(method(setTileGroup:forColumn:row:))]
#[unsafe(method_family = none)]
pub unsafe fn setTileGroup_forColumn_row(
&self,
tile_group: Option<&SKTileGroup>,
column: NSUInteger,
row: NSUInteger,
);
#[cfg(all(feature = "SKTileDefinition", feature = "SKTileSet"))]
/// Set the tile group and tile defintion at the specified tile index. When automapping is enabled, it will attempt to resolve the surrounding tiles to allow the specified tile definition to be placed. When automapping is disabled, it will simply place the tile definition and not modify any of the neighboring tiles.
///
/// Parameter `tileGroup`: the tile group we want to place in the map
///
/// Parameter `tileDefinition`: the tile definition we want to place in the map
///
/// Parameter `column`: the column index of the tile
///
/// Parameter `row`: the row index of the tile
#[unsafe(method(setTileGroup:andTileDefinition:forColumn:row:))]
#[unsafe(method_family = none)]
pub unsafe fn setTileGroup_andTileDefinition_forColumn_row(
&self,
tile_group: &SKTileGroup,
tile_definition: &SKTileDefinition,
column: NSUInteger,
row: NSUInteger,
);
#[cfg(feature = "objc2-core-foundation")]
/// Returns the column index of the tile that lies under the specified position. Returns NSUIntegerMax if the position does not fall within the tile map.
///
/// Parameter `position`: the position we want to check against the tile map
#[unsafe(method(tileColumnIndexFromPosition:))]
#[unsafe(method_family = none)]
pub unsafe fn tileColumnIndexFromPosition(&self, position: CGPoint) -> NSUInteger;
#[cfg(feature = "objc2-core-foundation")]
/// Returns the row index of the tile that lies under the specified position. Returns NSUIntegerMax if the position does not fall within the tile map.
///
/// Parameter `position`: the position we want to check against the tile map
#[unsafe(method(tileRowIndexFromPosition:))]
#[unsafe(method_family = none)]
pub unsafe fn tileRowIndexFromPosition(&self, position: CGPoint) -> NSUInteger;
#[cfg(feature = "objc2-core-foundation")]
/// Returns the position of the center of the tile at the specified column and row.
///
/// Parameter `column`: the column index of the tile
///
/// Parameter `row`: the row index of the tile
#[unsafe(method(centerOfTileAtColumn:row:))]
#[unsafe(method_family = none)]
pub unsafe fn centerOfTileAtColumn_row(
&self,
column: NSUInteger,
row: NSUInteger,
) -> CGPoint;
);
}
/// Methods declared on superclass `SKNode`.
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
impl SKTileMapNode {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
/// Support coding and decoding via NSKeyedArchiver.
///
/// # Safety
///
/// `a_decoder` possibly has further requirements.
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
a_decoder: &NSCoder,
) -> Option<Retained<Self>>;
#[unsafe(method(node))]
#[unsafe(method_family = none)]
pub unsafe fn node(mtm: MainThreadMarker) -> Retained<Self>;
#[unsafe(method(nodeWithFileNamed:))]
#[unsafe(method_family = none)]
pub unsafe fn nodeWithFileNamed(
filename: &NSString,
mtm: MainThreadMarker,
) -> Option<Retained<Self>>;
/// # Safety
///
/// `classes` generic probably has further requirements.
#[unsafe(method(nodeWithFileNamed:securelyWithClasses:andError:_))]
#[unsafe(method_family = none)]
pub unsafe fn nodeWithFileNamed_securelyWithClasses_andError(
filename: &NSString,
classes: &NSSet<AnyClass>,
mtm: MainThreadMarker,
) -> Result<Retained<Self>, Retained<NSError>>;
);
}
/// Methods declared on superclass `NSObject`.
#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
impl SKTileMapNode {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}