Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to create different menu for drawing different object..plz help.. #36

Closed
GoogleCodeExporter opened this issue Mar 4, 2016 · 3 comments

Comments

@GoogleCodeExporter
Copy link

Hi Everybody,

I am trying to create menu for drawing different object in same marker. that 
menas if i switch cube menu it will be drawn cube and if i change menu to 
triangle it will be drawn triangle but in same marker. But I don't understand 
how i can do this. Basically I tried following way to implement menuitem in 
customobject class:

package edu.dhbw.andar.pub;

public class CustomObject extends ARObject {

    public CustomObject(String name, String patternName,
            double markerWidth, double[] markerCenter) {
..............
..............}

    public final void draw(GL10 gl) {
        super.draw(gl);
}
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {     
        menu.add(0, MENU_SCREENSHOT, 0, getResources().getText(R.string.takescreenshot))
        .setIcon(R.drawable.screenshoticon);
        menu.add(0, MENU_SCREENSHOT1, 0, getResources().getText(R.string.takescreenshot1))
        .setIcon(R.drawable.screenshoticon);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {

...........
........

        switch(item.getItemId()) {
        case MENU_SCREENSHOT:
            new TakeAsyncScreenshot().execute();
            break;

        }
        switch(item.getItemId()) {
        case MENU_SCREENSHOT1:
            new TakeAsyncScreenshot().execute();
            break;

        }

class TakeAsyncScreenshot extends AsyncTask<Void, Void, Void> {

{
 box.draw(gl);///should be call box function
}



but its seems no effect when press menu item after program open.

Anybody can help me that how i can implement differet menu item for drawing 
different object in same marker.

Thanks
Rassall 

Original issue reported on code.google.com by rassall....@gmail.com on 6 Oct 2010 at 5:00

@GoogleCodeExporter
Copy link
Author

you can not override the method onCreateOptionsMenu of ARObject, because it 
does not exist.
you have to implement your menu in an activity, as you can read in 
http://developer.android.com/guide/topics/ui/menus.html

please use the google groups for anything that is not an bug report:
http://groups.google.de/group/andar_android_augmented_reality

i'm closing this issue because it is not an bug report.

Original comment by tdomhan on 6 Oct 2010 at 11:59

  • Changed state: Invalid

@GoogleCodeExporter
Copy link
Author

Thanks tdomhan,

I able to create menus to draw different object on one marker and its(menu) 
work fine.

Regards
Rassall

Original comment by rassall....@gmail.com on 11 Oct 2010 at 8:15

@GoogleCodeExporter
Copy link
Author

it's possible to see your code ?
I have the same problem here !


regard.

Original comment by guillaum...@gmail.com on 6 Apr 2012 at 3:14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant