com.craftar
Class CraftARContentImage
- java.lang.Object
- com.craftar.CraftARContentBase
- com.craftar.CraftARContent
- com.craftar.CraftARContentImage
- com.craftar.CraftARContent
- com.craftar.CraftARContentBase
public class CraftARContentImage extends CraftARContent
An Image content for aCraftARItemAR
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.craftar.CraftARContent
CraftARContent.ContentStatus, CraftARContent.ContentTouchEvent, CraftARContent.ContentWrapMode, CraftARContent.LoadContentInBackground
-
Nested classes/interfaces inherited from class com.craftar.CraftARContentBase
CraftARContentBase.ContentType, CraftARContentBase.ContentTypeName
-
-
Field Summary
Fields Modifier and Type Field and Description protected java.lang.String
mImageUri
-
Fields inherited from class com.craftar.CraftARContent
isAppInBg, mAlpha, mClickListener, mContentID, mHyperlinkUrl, mId, mNativeContentPtr, mRotationMatrix, mScale, mStatus, mTouchEventListener, mTranslation, mType, mUUID, mWrapMode
-
-
Constructor Summary
Constructors Constructor and Description CraftARContentImage(JSONObject object)
Create aCraftARContentImage
from a JSON that comes from the CraftAR service.CraftARContentImage(java.lang.String imageUri)
Create aCraftARContentImage
defining it's image programatically.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description protected void
contentLoadFinalized(boolean success)
The content resources finished loading.protected void
drawWithItemPose(float[] translation, float[] rotation, int drawMode)
Draws the content according to it's parent ARItem pose.protected void
finalize()
void
update()
Internal updateprotected void
updateContentAttributes()
Receives a notification that the content attributes (scale, pose, translation) have been modified.-
Methods inherited from class com.craftar.CraftARContent
cancelContentLoad, getAlpha, getContentType, getRotationMatrix, getScale, getStatus, getTranslation, getUUID, getWrapMode, onAppFinish, onAppPause, onAppResume, onDestroyedForOrientationChange, setAlpha, setContentClickListener, setContentTouchEventListener, setContentVersion, setRotationMatrix, setScale, setTranslation, setWrapMode
-
Methods inherited from class com.craftar.CraftARContentBase
clearContentResources, contentTypeFromJSON, trackingLost, trackingStarted
-
-
-
-
Constructor Detail
-
CraftARContentImage
public CraftARContentImage(java.lang.String imageUri)
Create aCraftARContentImage
defining it's image programatically.- Parameters:
imageUri
- Can be either a URL http://example.com/image.jpg or a local URI.
-
CraftARContentImage
public CraftARContentImage(JSONObject object) throws CraftARSDKException
Create aCraftARContentImage
from a JSON that comes from the CraftAR service. *- Parameters:
contentJSON
- describing this content- Throws:
CraftARSDKException
-
-
Method Detail
-
drawWithItemPose
protected void drawWithItemPose(float[] translation, float[] rotation, int drawMode)
Draws the content according to it's parent ARItem pose.- Specified by:
drawWithItemPose
in classCraftARContent
-
update
public void update()
Description copied from class:CraftARContent
Internal update- Overrides:
update
in classCraftARContent
-
finalize
protected void finalize()
- Overrides:
finalize
in classCraftARContent
-
contentLoadFinalized
protected void contentLoadFinalized(boolean success)
The content resources finished loading.- Specified by:
contentLoadFinalized
in classCraftARContent
- Parameters:
success
- True if the content was loaded successfully, false otherwise.
-
updateContentAttributes
protected void updateContentAttributes()
Receives a notification that the content attributes (scale, pose, translation) have been modified. You can modify the attributes of anyCraftARContent
at runtime using the methodssetTranslation
,setRotationMatrix
,and setScale
.- Specified by:
updateContentAttributes
in classCraftARContent
-
-
Comments
0 comments
Article is closed for comments.