mohsennavazani / andar

Automatically exported from code.google.com/p/andar
0 stars 0 forks source link

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

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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 commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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 commented 8 years ago
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