v0.0.7game_levels_scrolling_map
Flutter를 사용하여 캔디 크러시 또는 유사한 게임의 게임 레벨 맵을 만들 수 있는 패키지로 가로 또는 세로 방향으로 설정할 수 있습니다.
Flutter를 사용하여 캔디 크러시 또는 유사한 게임의 게임 레벨 맵을 만들 수 있는 플러터 패키지로, 가로 또는 세로로 배치할 수 있습니다
{"sdk":"flutter"}^5.1.2^2.0.0{"sdk":"flutter"}^1.0.0아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
A package for making game levels map like candy crush or similar games using flutter with ability to be horizontal or vertical
| Android ✔️ | IOS ✔️ | MacOS ✔️ ️| Web ✔️ | Linux ✔️ | Windows ✔ ️|
Step 1 Import package:game_levels_scrolling_map/game_levels_scrolling_map.dart which contain the main widget of the map GameLevelsScrollingMap
then Import package:game_levels_scrolling_map/model/point_model.dart which contain the model of points
Step 2 Start adding your points widgets by creating a new List of points and adding widgets to it using the PointModel class
List<PointModel> points = [];
for(int i = 0; i<50 ; i++){
PointModel point = PointModel(100,Container(width: 40, height: 40, color: Colors.red, child: Text("$i")));
/* To make the map scroll to a specific point just make its parameter 'isCurrent' = true like the following which will make the map scroll to it once created*/
if(i == 20) point.isCurrent = true;
points.add(point);
}
Step 3 Use GameLevelScrollingMap.scrollable widget to build the map
- To make vertical map:
Vertical Map Example
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: GameLevelsScrollingMap.scrollable(
imageUrl: "assets/drawable/map_vertical.png",
direction: Axis.vertical,
reverseScrolling: true,
svgUrl: 'assets/svg/map_vertical.svg',
points: points,)
),
);
}
- To make horizontal map:
Horizontal Map Example
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: GameLevelsScrollingMap.scrollable(
imageUrl: "assets/drawable/map_horizontal.png",
direction: Axis.horizontal,
svgUrl: 'assets/svg/map_horizontal.svg',
points: points,)
),
);
}