zuijinbuzai / flutter_puzzle Goto Github PK
View Code? Open in Web Editor NEWflutter puzzle game sample
flutter puzzle game sample
https://github.com/zuijinbuzai/flutter_puzzle/blob/master/img/1.jpg
Did you implement Jigsaw Puzzle in it, because I did not find the code in it.
A value of type 'Future' can't be assigned to a variable of type 'Image'.
Try changing the type of the variable, or casting the right-hand type to 'Image'.dart(invalid_assignment)
node.image = recorder.endRecording().toImage(ww.floor(), ww.floor());
` void makeBitmap(ImageNode node) {
int i = node.getXIndex(level);
int j = node.getYIndex(level);
Rect rect = getShapeRect(i, j, eachBitmapWidth);
rect = rect.shift(
Offset(eachBitmapWidth.toDouble() * i, eachBitmapWidth.toDouble() * j));
PictureRecorder recorder = PictureRecorder();
double ww = eachBitmapWidth.toDouble();
Canvas canvas = Canvas(recorder, Rect.fromLTWH(0.0, 0.0, ww, ww));
Rect rect2 = Rect.fromLTRB(0.0, 0.0, rect.width, rect.height);
Paint paint = Paint();
canvas.drawImageRect(image, rect, rect2, paint);
node.image = recorder.endRecording().toImage(ww.floor(), ww.floor());
node.rect = getOkRectF(i, j);
}
`
When i integrate this code into project. it works fine but when used rectangle image. some of the images not shown and not fit in screen. Below is snapshot. How can i resolve it. Please let me know or tell me where i have to change.
https://drive.google.com/file/d/1xA4AL99J87VyTVP_cao2uVFLLaT5NoM5/view?usp=sharing
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.