亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? sprite.java

?? 這是j2me里MIDP2.0中g(shù)ame包的源代碼
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
     * before transformation. This corner may no longer appear as the     * upper-left corner in the painter's coordinate system under     * current transformation.     * <p>     * By default, a Sprite's reference pixel is located at (0,0); that is,     * the pixel in the upper-left corner of the raw frame.     * <p>     * Changing the reference pixel does not change the     * Sprite's physical position in the painter's coordinate system;     * that is, the values returned by {@link #getX getX()} and     * {@link #getY getY()} will not change as a result of defining the     * reference pixel.  However, subsequent calls to methods that     * involve the reference pixel will be impacted by its new definition.     *     * @param x the horizontal location of the reference pixel, relative     * to the left edge of the un-transformed frame     * @param y the vertical location of the reference pixel, relative     * to the top edge of the un-transformed frame     * @see #setRefPixelPosition     * @see #getRefPixelX     * @see #getRefPixelY     */    public void defineReferencePixel(int x, int y) {	dRefX = x;	dRefY = y;    }        /**     * Sets this Sprite's position such that its reference pixel is located     * at (x,y) in the painter's coordinate system.     * @param x the horizontal location at which to place the reference pixel     * @param y the vertical location at which to place the reference pixel     * @see #defineReferencePixel     * @see #getRefPixelX     * @see #getRefPixelY     */	     public void setRefPixelPosition(int x, int y) {	// update this.x and this.y	this.x = x - getTransformedPtX(dRefX, dRefY, 				       this.t_currentTransformation);	this.y = y - getTransformedPtY(dRefX, dRefY, 				       this.t_currentTransformation);    }    /**     * Gets the horizontal position of this Sprite's reference pixel     * in the painter's coordinate system.       * @return the horizontal location of the reference pixel     * @see #defineReferencePixel     * @see #setRefPixelPosition     * @see #getRefPixelY     */	     public int getRefPixelX() {	return (this.x +		getTransformedPtX(dRefX, dRefY, this.t_currentTransformation));    }	    /**     * Gets the vertical position of this Sprite's reference pixel     * in the painter's coordinate system.     * @return the vertical location of the reference pixel     * @see #defineReferencePixel     * @see #setRefPixelPosition     * @see #getRefPixelX     */	     public int getRefPixelY() {	return (this.y + 		getTransformedPtY(dRefX, dRefY, this.t_currentTransformation));    }    /**     * Selects the current frame in the frame sequence.  <p>     * The current frame is rendered when {@link #paint(Graphics)} is called.     * <p>     * The index provided refers to the desired entry in the frame sequence,      * not the index of the actual frame itself.     * @param sequenceIndex the index of of the desired entry in the frame      * sequence      * @throws IndexOutOfBoundsException if <code>frameIndex</code> is     * less than<code>0</code>     * @throws IndexOutOfBoundsException if <code>frameIndex</code> is     * equal to or greater than the length of the current frame     * sequence (or the number of raw frames for the default sequence)     * @see #setFrameSequence(int[])     * @see #getFrame     */    public void setFrame(int sequenceIndex) {        if (sequenceIndex < 0 || sequenceIndex >= frameSequence.length) {            throw new IndexOutOfBoundsException();	}	this.sequenceIndex = sequenceIndex;    }    /**     * Gets the current index in the frame sequence.  <p>     * The index returned refers to the current entry in the frame sequence,     * not the index of the actual frame that is displayed.     *     * @return the current index in the frame sequence      * @see #setFrameSequence(int[])     * @see #setFrame     */    public final int getFrame() {        return sequenceIndex;    }    /**     * Gets the number of raw frames for this Sprite.  The value returned      * reflects the number of frames; it does not reflect the length of the      * Sprite's frame sequence.  However, these two values will be the same     * if the default frame sequence is used.     *     * @return the number of raw frames for this Sprite     * @see #getFrameSequenceLength     */    public int getRawFrameCount() {        return numberFrames;    }    /**     * Gets the number of elements in the frame sequence.  The value returned     * reflects the length of the Sprite's frame sequence; it does not reflect     * the number of raw frames.  However, these two values will be the same      * if the default frame sequence is used.     *     * @return the number of elements in this Sprite's frame sequence     * @see #getRawFrameCount     */    public int getFrameSequenceLength() {        return frameSequence.length;    }    /**     * Selects the next frame in the frame sequence.  <p>     *     * The frame sequence is considered to be circular, i.e. if      * {@link #nextFrame} is called when at the end of the sequence,     * this method will advance to the first entry in the sequence.     *     * @see #setFrameSequence(int[])     * @see #prevFrame     */    public void nextFrame() {        sequenceIndex = (sequenceIndex + 1) % frameSequence.length;    }    /**     * Selects the previous frame in the frame sequence.  <p>     *     * The frame sequence is considered to be circular, i.e. if     * {@link #prevFrame} is called when at the start of the sequence,     * this method will advance to the last entry in the sequence.     *     * @see #setFrameSequence(int[])     * @see #nextFrame     */    public void prevFrame() {	if (sequenceIndex == 0) {            sequenceIndex = frameSequence.length - 1;	} else {            sequenceIndex--;	}    }    /**     * Draws the Sprite.       * <P>     * Draws current frame of Sprite using the provided Graphics object.     * The Sprite's upper left corner is rendered at the Sprite's current     * position relative to the origin of the Graphics object.  The current     * position of the Sprite's upper-left corner can be retrieved by      * calling {@link #getX()} and {@link #getY()}.     * <P>     * Rendering is subject to the clip region of the Graphics object.     * The Sprite will be drawn only if it is visible.     * <p>     * If the Sprite's Image is mutable, the Sprite is rendered using the     * current contents of the Image.     *      * @param g the graphics object to draw <code>Sprite</code> on     * @throws NullPointerException if <code>g</code> is <code>null</code>     *     */    public final void paint(Graphics g) {	// managing the painting order is the responsibility of	// the layermanager, so depth is ignored        if (g == null) {            throw new NullPointerException();        }        if (visible) {                // width and height of the source                // image is the width and height                // of the original frame		g.drawRegion(sourceImage, 			     frameCoordsX[frameSequence[sequenceIndex]],			     frameCoordsY[frameSequence[sequenceIndex]],			     srcFrameWidth, 			     srcFrameHeight,			     t_currentTransformation,			     this.x, 			     this.y, 			     Graphics.TOP | Graphics.LEFT);        }    }    /**     * Set the frame sequence for this Sprite.  <p>     *     * All Sprites have a default sequence that displays the Sprites     * frames in order.  This method allows for the creation of an     * arbitrary sequence using the available frames.  The current     * index in the frame sequence is reset to zero as a result of      * calling this method.     * <p>     * The contents of the sequence array are copied when this method     * is called; thus, any changes made to the array after this method     * returns have no effect on the Sprite's frame sequence.     * <P>     * Passing in <code>null</code> causes the Sprite to revert to the     * default frame sequence.<p>     *     * @param sequence an array of integers, where each integer represents     * a frame index     *            * @throws ArrayIndexOutOfBoundsException if seq is non-null and any member     *         of the array has a value less than <code>0</code> or     *         greater than or equal to the     *         number of frames as reported by {@link #getRawFrameCount()}     * @throws IllegalArgumentException if the array has less than     * <code>1</code> element     * @see #nextFrame     * @see #prevFrame     * @see #setFrame     * @see #getFrame     *     */    public void setFrameSequence(int sequence[]) {        if (sequence == null) {	    // revert to the default sequence	    sequenceIndex = 0;	    customSequenceDefined = false;	    frameSequence = new int[numberFrames];	    // copy frames indices into frameSequence            for (int i = 0; i < numberFrames; i++)	    {                frameSequence[i] = i;            }            return;        }	if (sequence.length < 1) {             throw new IllegalArgumentException();	}        for (int i = 0; i < sequence.length; i++)	{            if (sequence[i] < 0 || sequence[i] >= numberFrames) {		throw new ArrayIndexOutOfBoundsException();	    }	}	customSequenceDefined = true;	frameSequence = new int[sequence.length];        System.arraycopy(sequence, 0, frameSequence, 0, sequence.length);	sequenceIndex = 0;    }        /**     * Changes the Image containing the Sprite's frames.       * <p>     * Replaces the current raw frames of the Sprite with a new set of raw     * frames.  See the constructor {@link #Sprite(Image, int, int)} for     * information on how the frames are created from the image.  The      * values returned by {@link Layer#getWidth} and {@link Layer#getHeight}     * will reflect the new frame width and frame height subject to the      * Sprite's current transform.     * <p>     * Changing the image for the Sprite could change the number of raw      * frames.  If the new frame set has as many or more raw frames than the     * previous frame set, then:     * <ul>     * <li>The current frame will be unchanged     * <li>If a custom frame sequence has been defined (using      *     {@link #setFrameSequence(int[])}), it will remain unchanged.  If no     *     custom frame sequence is defined (i.e. the default frame     *     sequence     *     is in use), the default frame sequence will be updated to     *     be the default frame sequence for the new frame set.  In other     *     words, the new default frame sequence will include all of the     *     frames from the new raw frame set, as if this new image had been     *     used in the constructor.     * </ul>     * <p>     * If the new frame set has fewer frames than the previous frame set,      * then:     * <ul>     * <li>The current frame will be reset to entry 0     * <li>Any custom frame sequence will be discarded and the frame sequence     *     will revert to the default frame sequence for the new frame     *     set.     * </ul>     * <p>     * The reference point location is unchanged as a result of calling this      * method, both in terms of its defined location within the Sprite and its     * position in the painter's coordinate system.  However, if the frame     * size is changed and the Sprite has been transformed, the position of      * the Sprite's upper-left corner may change such that the reference      * point remains stationary.     * <p>     * If the Sprite's frame size is changed by this method, the collision      * rectangle is reset to its default value (i.e. it is set to the new      * bounds of the untransformed Sprite).     * <p>      * @param img the <code>Image</code> to use for     * <code>Sprite</code>     * @param frameWidth the width in pixels of the individual raw frames     * @param frameHeight the height in pixels of the individual raw frames     * @throws NullPointerException if <code>img</code> is <code>null</code>     * @throws IllegalArgumentException if <code>frameHeight</code> or      * <code>frameWidth</code> is less than <code>1</code>     * @throws IllegalArgumentException if the image width is not an integer     * multiple of the <code>frameWidth</code>     * @throws IllegalArgumentException if the image height is not an integer      * multiple of the <code>frameHeight</code>     */    public void setImage(Image img, int frameWidth, int frameHeight) {        // if image is null image.getWidth() will throw NullPointerException        if ((frameWidth < 1 || frameHeight < 1) ||	    ((img.getWidth() % frameWidth) != 0) ||	    ((img.getHeight() % frameHeight) != 0)) {             throw new IllegalArgumentException();	}	int noOfFrames =           (img.getWidth() / frameWidth)*(img.getHeight() / frameHeight);	boolean maintainCurFrame = true;	if (noOfFrames < numberFrames) {            // use default frame , sequence index = 0	    maintainCurFrame = false; 	    customSequenceDefined = false;	}	if (! ((srcFrameWidth == frameWidth) &&               (srcFrameHeight == frameHeight))) {	    // computing is the location            // of the reference pixel in the painter's coordinate system.	    // and then use this to find x and y position of the Sprite	    int oldX = this.x + 		getTransformedPtX(dRefX, dRefY, this.t_currentTransformation);	    int oldY = this.y +		getTransformedPtY(dRefX, dRefY, this.t_currentTransformation);	    setWidthImpl(frameWidth);	    setHeightImpl(frameHeight);	    initializeFrames(img, frameWidth, frameHeight, maintainCurFrame);	    // initialize collision rectangle	    initCollisionRectBounds();	    // set the new x and y position of the Sprite	    this.x = oldX - 		getTransformedPtX(dRefX, dRefY, this.t_currentTransformation);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
337p亚洲精品色噜噜噜| 国产乱码精品1区2区3区| 91精品国产一区二区| 成人激情动漫在线观看| 国产又黄又大久久| 精品视频999| 欧美人牲a欧美精品| 成人黄色大片在线观看| 国产成人午夜99999| 国产精品白丝av| 国产成人综合网| 风间由美一区二区三区在线观看 | 91精品国产欧美一区二区18| 国产一区二区三区精品欧美日韩一区二区三区 | 菠萝蜜视频在线观看一区| 麻豆freexxxx性91精品| 麻豆视频一区二区| 蜜臀av性久久久久蜜臀aⅴ四虎| 亚洲男人的天堂在线aⅴ视频| 久久精品一二三| 中国色在线观看另类| 亚洲影视资源网| 亚洲小说欧美激情另类| 国产一区二区三区四| 夜夜嗨av一区二区三区| 亚洲综合丁香婷婷六月香| 久久疯狂做爰流白浆xx| 欧美视频在线不卡| 国产精品视频在线看| 韩国女主播成人在线| 亚洲国产cao| 亚洲免费观看高清完整版在线观看| 日韩av一区二区三区| 在线一区二区三区四区| 国产精品福利一区| 懂色av一区二区三区免费观看| 久久先锋影音av| 国产老妇另类xxxxx| 久久天天做天天爱综合色| 蜜臀av性久久久久蜜臀av麻豆| 欧美日韩成人在线| 亚洲国产精品一区二区www| www.亚洲精品| 91精品午夜视频| 亚洲免费资源在线播放| 国产一区二区三区观看| 欧美剧在线免费观看网站| 亚洲精品国产一区二区精华液 | 亚洲欧洲韩国日本视频| 美女看a上一区| 欧美剧在线免费观看网站| 一区二区欧美视频| 99久久精品久久久久久清纯| 久久综合九色综合97_久久久| 亚洲一区二区三区四区在线观看 | 国产成人综合网| 国产亲近乱来精品视频| 国产在线视视频有精品| 日韩片之四级片| 国产精品一品二品| 国产欧美日韩卡一| 成年人网站91| 久久av老司机精品网站导航| 在线观看亚洲一区| 一区二区三区高清| 欧美日产在线观看| 久久99国产精品麻豆| 欧美精品一区二区三区视频| 国产综合色视频| 亚洲国产精品精华液2区45| 成人午夜av在线| 亚洲黄色av一区| 777奇米四色成人影色区| 九色综合狠狠综合久久| 国产欧美日韩视频一区二区| 国产精品一级二级三级| 国产精品久久久久天堂| 色噜噜久久综合| 美洲天堂一区二卡三卡四卡视频| 欧美www视频| 99久久精品国产网站| 日韩va亚洲va欧美va久久| 久久久噜噜噜久久人人看| 99精品在线观看视频| 天天色综合天天| 亚洲欧美自拍偷拍| 欧美一区二区三区色| 成人精品高清在线| 日本午夜精品视频在线观看| 国产午夜精品一区二区三区嫩草 | 精品日韩一区二区三区| 国产乱子伦视频一区二区三区 | 成人av在线网| 麻豆国产精品一区二区三区| 国产精品电影一区二区三区| 欧美一区二区在线看| 在线观看日韩av先锋影音电影院| 91精品91久久久中77777| 久久aⅴ国产欧美74aaa| 午夜精品福利视频网站| 一区二区三区四区高清精品免费观看 | 亚洲一区在线观看网站| 国产精品不卡一区| 国产精品网曝门| 国产日韩三级在线| 久久久国产综合精品女国产盗摄| 在线综合视频播放| 91精品国产一区二区人妖| 欧美精品国产精品| 欧美性猛片aaaaaaa做受| 色噜噜狠狠色综合中国| 97久久超碰国产精品| 97精品国产露脸对白| 99精品久久只有精品| 97久久精品人人做人人爽50路 | 亚洲一区在线视频观看| 亚洲一区在线观看视频| 亚洲不卡在线观看| 奇米精品一区二区三区在线观看| 日本成人超碰在线观看| 久久av资源网| 不卡一区二区在线| 91精品国产丝袜白色高跟鞋| 久久综合九色综合97_久久久| 欧美国产欧美亚州国产日韩mv天天看完整| 亚洲美女视频在线观看| 日本不卡在线视频| 99久久er热在这里只有精品66| 欧美一区二区福利在线| 亚洲婷婷综合久久一本伊一区| 一区二区日韩av| 成人h动漫精品一区二| 欧美一二区视频| 亚洲午夜精品在线| 国产91精品露脸国语对白| 欧美一级一区二区| 亚洲va国产va欧美va观看| 成人爽a毛片一区二区免费| 日韩欧美国产三级| 亚洲国产欧美一区二区三区丁香婷| 精品制服美女丁香| 日韩一区二区免费高清| 久久97超碰色| 国产成人免费视频| 在线免费亚洲电影| 久久精品一区二区三区av| 怡红院av一区二区三区| 伦理电影国产精品| 色综合久久久久综合体桃花网| 欧美一区二区二区| 成人免费在线视频| 美女mm1313爽爽久久久蜜臀| 91丝袜国产在线播放| 国产日韩欧美综合一区| 毛片不卡一区二区| 欧美疯狂性受xxxxx喷水图片| 国产精品美日韩| 国产精品中文字幕日韩精品| 欧美日韩免费电影| 伊人色综合久久天天人手人婷| 国产成人亚洲精品青草天美| 日韩欧美中文字幕一区| 日韩激情一区二区| 91精品欧美综合在线观看最新| 亚洲永久精品国产| 欧美性感一类影片在线播放| 亚洲视频图片小说| 一本到三区不卡视频| 一区二区三区蜜桃| 色婷婷久久综合| 一区二区三区中文字幕电影| 色噜噜狠狠色综合中国| 亚洲午夜激情网页| 日韩欧美一区二区在线视频| 日韩综合小视频| 26uuu成人网一区二区三区| 国产精品综合av一区二区国产馆| 亚洲精品在线免费观看视频| 国产精品原创巨作av| 国产精品妹子av| 在线视频亚洲一区| 精品一区二区国语对白| 久久精品夜色噜噜亚洲aⅴ| 99久久精品免费看国产免费软件| 亚洲欧美成人一区二区三区| 欧美日韩中文国产| 欧美群妇大交群中文字幕| 亚洲电影中文字幕在线观看| 日韩午夜激情视频| av资源网一区| 亚洲高清中文字幕| 国产午夜精品福利| 欧美日韩国产系列| 国产成人鲁色资源国产91色综| 中文字幕日韩av资源站| 日韩精品一区二区三区视频 | 高清shemale亚洲人妖| 亚洲国产精品天堂| 国产精品乱人伦中文| 欧美一区二区三区在线观看|