在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:Larpon/ingrid开源软件地址:https://github.com/Larpon/ingrid开源编程语言:GDScript 100.0%开源软件介绍:Infinity Grid (InGrid)An infinite scrolling grid for the Godot game engine (3.x). A solid component - excellent for things like:
Features
ImportantHow Stuff Works™
In order for the grid to be "infinite" the movement model of the grid is like that of a Each cell's When a grid cell leave the viewport, it's InstallSimply clone this repository into your project's cd "<path/to/project/root>"
mkdir -p "addons"
cd addons
git clone [email protected]:Larpon/ingrid.git UsageUse The grid will work out of the box, with sane defaults, but you won't see much unless you do a few things first. Initialize To initialize the grid with (optional) custom values func _ready():
# Optional
$Grid2D.cell_size = Vector2(256,256)
$Grid2D.delegate = "res://<path/to/custom/MyCustomCell.tscn>"
$Grid2D.units = Vector2(1,1)
$Grid2D.connect("initialized",self,"_on_grid_initialized")
# Mandatory
$Grid2D.init()
func _on_grid_initialized():
$Grid2D.warp(Vector2(0,0)) Move the grid func _process(delta):
# Moves the grid one pixel right, relative to it's current position
$Grid2D.move(Vector2(1,0)) Cell delegates func _ready():
...
$Grid2D.delegate = "res://<path/to/custom/Cell.tscn>"
... To make the grid seem infinite you'll want to derrive from the supplied Cell units func _ready():
...
$Grid2D.units = Vector2(1,1)
... Cell units can be any Here's a few examples: # Every cell.xy increases by 0.5 on each axis on each cell swap
$Grid2D.units = Vector2(0.5,0.5)
# Every cell.xy increases by 10 on each axis on each cell swap
$Grid2D.units = Vector2(10,10) What units you choose to act on is your choice - and your choice alone Known issuesThere's currently a few known issues you need to consider before deciding to use this.
Support my workWebringCheck out my games and other indie dev stuff
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论