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
131131# This is used to compare different versions of the same Library, and check if
132132# an update is available.
133133
134- library.version =6
134+ library.version =7
135135
136136
137137# The version as the user will see it.
138138
139- library.prettyVersion =1.5 .0
139+ library.prettyVersion =1.6 .0
140140
141141
142142# 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() {
457457 return this .costumes .get (this .currentCostume ).getImage ().height ;
458458 }
459459
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+
460470 /**
461471 * Return the default timer
462472 * @return the default timer
Original file line number Diff line number Diff line change @@ -250,6 +250,32 @@ public void changeTransparency(float step) {
250250 this .backdrops .get (this .currentBackdrop ).changeTransparency (step );
251251 }
252252
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+
253279 /**
254280 * Returns the timer
255281 * @return the timer
You can’t perform that action at this time.
0 commit comments