File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed
src/eu/barkmin/processing/scratch Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -131,12 +131,12 @@ source.repository=https://github.com/mikebarkmin/processing-library-scratch.git
131
131
# This is used to compare different versions of the same Library, and check if
132
132
# an update is available.
133
133
134
- library.version =6
134
+ library.version =7
135
135
136
136
137
137
# The version as the user will see it.
138
138
139
- library.prettyVersion =1.5 .0
139
+ library.prettyVersion =1.6 .0
140
140
141
141
142
142
# The min and max revision of Processing compatible with your Library.
Original file line number Diff line number Diff line change @@ -457,6 +457,16 @@ public int getHeight() {
457
457
return this .costumes .get (this .currentCostume ).getImage ().height ;
458
458
}
459
459
460
+ /**
461
+ * Return the pixels of the current costume or an empty array, when no costume is available.
462
+ * @return the pixels of the sprite
463
+ */
464
+ public int [] getPixels () {
465
+ if (costumes .size () == 0 ) return new int [0 ];
466
+
467
+ return this .costumes .get (this .currentCostume ).getImage ().pixels ;
468
+ }
469
+
460
470
/**
461
471
* Return the default timer
462
472
* @return the default timer
Original file line number Diff line number Diff line change @@ -250,6 +250,32 @@ public void changeTransparency(float step) {
250
250
this .backdrops .get (this .currentBackdrop ).changeTransparency (step );
251
251
}
252
252
253
+ /**
254
+ * Return the width of the current costume or the pen size, when no costume is available.
255
+ * @return the width of the sprite
256
+ */
257
+ public int getWidth () {
258
+ return ScratchStage .parent .width ;
259
+ }
260
+
261
+ /**
262
+ * Return the height of the current costume or the pen size, when no costume is available.
263
+ * @return the height of the sprite
264
+ */
265
+ public int getHeight () {
266
+ return ScratchStage .parent .height ;
267
+ }
268
+
269
+ /**
270
+ * Return the pixels of the current costume or an empty array, when no costume is available.
271
+ * @return the pixels of the sprite
272
+ */
273
+ public int [] getPixels () {
274
+ if (backdrops .size () == 0 ) return new int [0 ];
275
+
276
+ return this .backdrops .get (this .currentBackdrop ).getImage ().pixels ;
277
+ }
278
+
253
279
/**
254
280
* Returns the timer
255
281
* @return the timer
You can’t perform that action at this time.
0 commit comments