当前位置: 首页>>代码示例>>C++>>正文


C++ RuntimeScriptValue类代码示例

本文整理汇总了C++中RuntimeScriptValue的典型用法代码示例。如果您正苦于以下问题:C++ RuntimeScriptValue类的具体用法?C++ RuntimeScriptValue怎么用?C++ RuntimeScriptValue使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了RuntimeScriptValue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetManagedObjectAddressByKey

void* IAGSEngine::GetManagedObjectAddressByKey(int key) {
    void *object;
    ICCDynamicObject *manager;
    ScriptValueType obj_type = ccGetObjectAddressAndManagerFromHandle(key, object, manager);
    if (obj_type == kScValPluginObject)
    {
        GlobalReturnValue.SetPluginObject(object, manager);
    }
    else
    {
        GlobalReturnValue.SetDynamicObject(object, manager);
    }
    return object;
}
开发者ID:JackSamurai,项目名称:ags,代码行数:14,代码来源:agsplugin.cpp

示例2: GUIControl_GetAsTextBox

GUITextBox* GUIControl_GetAsTextBox(GUIObject *guio) {
  if (guis[guio->guin].get_control_type(guio->objn) != GOBJ_TEXTBOX)
    return NULL;

  GlobalReturnValue.SetDynamicObject(guio, &ccDynamicGUIObject);
  return (GUITextBox*)guio;
}
开发者ID:Cheeseness,项目名称:ags,代码行数:7,代码来源:guicontrol.cpp

示例3: GUIControl_GetAsSlider

GUISlider* GUIControl_GetAsSlider(GUIObject *guio) {
  if (guis[guio->guin].get_control_type(guio->objn) != GOBJ_SLIDER)
    return NULL;

  GlobalReturnValue.SetDynamicObject(guio, &ccDynamicGUIObject);
  return (GUISlider*)guio;
}
开发者ID:Cheeseness,项目名称:ags,代码行数:7,代码来源:guicontrol.cpp

示例4: GUIControl_GetAsLabel

GUILabel* GUIControl_GetAsLabel(GUIObject *guio) {
  if (guis[guio->guin].get_control_type(guio->objn) != GOBJ_LABEL)
    return NULL;

  GlobalReturnValue.SetDynamicObject(guio, &ccDynamicGUIObject);
  return (GUILabel*)guio;
}
开发者ID:Cheeseness,项目名称:ags,代码行数:7,代码来源:guicontrol.cpp

示例5: GUIControl_GetAsInvWindow

GUIInv* GUIControl_GetAsInvWindow(GUIObject *guio) {
  if (guis[guio->guin].get_control_type(guio->objn) != GOBJ_INVENTORY)
    return NULL;

  GlobalReturnValue.SetDynamicObject(guio, &ccDynamicGUIObject);
  return (GUIInv*)guio;
}
开发者ID:Cheeseness,项目名称:ags,代码行数:7,代码来源:guicontrol.cpp

示例6: GUIControl_GetAsButton

GUIButton* GUIControl_GetAsButton(GUIObject *guio) {
  if (guis[guio->guin].get_control_type(guio->objn) != GOBJ_BUTTON)
    return NULL;

  GlobalReturnValue.SetDynamicObject(guio, &ccDynamicGUIObject);
  return (GUIButton*)guio;
}
开发者ID:Cheeseness,项目名称:ags,代码行数:7,代码来源:guicontrol.cpp

示例7: DynamicSprite_CreateFromDrawingSurface

ScriptDynamicSprite* DynamicSprite_CreateFromDrawingSurface(ScriptDrawingSurface *sds, int x, int y, int width, int height) 
{
    int gotSlot = spriteset.findFreeSlot();
    if (gotSlot <= 0)
        return NULL;

    // use DrawingSurface resolution
    sds->MultiplyCoordinates(&x, &y);
    sds->MultiplyCoordinates(&width, &height);

    sds->StartDrawing();

    if ((x < 0) || (y < 0) || (x + width > abuf->GetWidth()) || (y + height > abuf->GetHeight()))
        quit("!DynamicSprite.CreateFromDrawingSurface: requested area is outside the surface");

    int colDepth = abuf->GetColorDepth();

    Bitmap *newPic = BitmapHelper::CreateBitmap(width, height, colDepth);
    if (newPic == NULL)
        return NULL;

    newPic->Blit(abuf, x, y, 0, 0, width, height);

    sds->FinishedDrawingReadOnly();

    add_dynamic_sprite(gotSlot, newPic, (sds->hasAlphaChannel != 0));
    ScriptDynamicSprite *new_spr = new ScriptDynamicSprite(gotSlot);
    GlobalReturnValue.SetDynamicObject(new_spr, new_spr);
    return new_spr;
}
开发者ID:Cheeseness,项目名称:ags,代码行数:30,代码来源:dynamicsprite.cpp

示例8: GetRegionAt

ScriptRegion *GetRegionAtLocation(int xx, int yy) {
    int hsnum = GetRegionAt(xx, yy);
    if (hsnum < 0)
        hsnum = 0;
    GlobalReturnValue.SetDynamicObject(&scrRegion[hsnum], &ccDynamicRegion);
    return &scrRegion[hsnum];
}
开发者ID:Cheeseness,项目名称:ags,代码行数:7,代码来源:region.cpp

示例9: GetGUIObjectAt

int GetGUIObjectAt (int xx, int yy) {
    GUIObject *toret = GetGUIControlAtLocation(xx, yy);
    GlobalReturnValue.Invalidate();
    if (toret == NULL)
        return -1;

    return toret->objn;
}
开发者ID:Cheeseness,项目名称:ags,代码行数:8,代码来源:global_gui.cpp

示例10: ViewFrame_GetLinkedAudio

ScriptAudioClip* ViewFrame_GetLinkedAudio(ScriptViewFrame *svf) 
{
  int soundIndex = views[svf->view].loops[svf->loop].frames[svf->frame].sound;
  if (soundIndex < 0)
    return NULL;

  GlobalReturnValue.SetDynamicObject(&game.audioClips[soundIndex], &ccDynamicAudioClip);
  return &game.audioClips[soundIndex];
}
开发者ID:Cheeseness,项目名称:ags,代码行数:9,代码来源:viewframe.cpp

示例11: DynamicSprite_CreateFromFile

ScriptDynamicSprite* DynamicSprite_CreateFromFile(const char *filename) {
    int slotnum = LoadImageFile(filename);
    if (slotnum) {
        ScriptDynamicSprite *new_spr = new ScriptDynamicSprite(slotnum);
        GlobalReturnValue.SetDynamicObject(new_spr, new_spr);
        return new_spr;
    }
    return NULL;
}
开发者ID:Cheeseness,项目名称:ags,代码行数:9,代码来源:dynamicsprite.cpp

示例12: DynamicSprite_CreateFromSaveGame

ScriptDynamicSprite* DynamicSprite_CreateFromSaveGame(int sgslot, int width, int height) {
    int slotnum = LoadSaveSlotScreenshot(sgslot, width, height);
    if (slotnum) {
        ScriptDynamicSprite *new_spr = new ScriptDynamicSprite(slotnum);
        GlobalReturnValue.SetDynamicObject(new_spr, new_spr);
        return new_spr;
    }
    return NULL;
}
开发者ID:Cheeseness,项目名称:ags,代码行数:9,代码来源:dynamicsprite.cpp

示例13: DynamicSprite_CreateFromScreenShot

ScriptDynamicSprite* DynamicSprite_CreateFromScreenShot(int width, int height) {

    int gotSlot = spriteset.findFreeSlot();
    if (gotSlot <= 0)
        return NULL;

    if (width <= 0)
        width = virtual_screen->GetWidth();
    else
        width = multiply_up_coordinate(width);

    if (height <= 0)
        height = virtual_screen->GetHeight();
    else
        height = multiply_up_coordinate(height);

    Bitmap *newPic;
    if (!gfxDriver->UsesMemoryBackBuffer()) 
    {
        // D3D driver
        Bitmap *scrndump = BitmapHelper::CreateBitmap(scrnwid, scrnhit, final_col_dep);
        gfxDriver->GetCopyOfScreenIntoBitmap(scrndump);

        update_polled_stuff_if_runtime();

        if ((scrnwid != width) || (scrnhit != height))
        {
            newPic = BitmapHelper::CreateBitmap(width, height, final_col_dep);
            newPic->StretchBlt(scrndump,
                RectWH(0, 0, scrndump->GetWidth(), scrndump->GetHeight()),
                RectWH(0, 0, width, height));
            delete scrndump;
        }
        else
        {
            newPic = scrndump;
        }
    }
    else
    {
        // resize the sprite to the requested size
        newPic = BitmapHelper::CreateBitmap(width, height, virtual_screen->GetColorDepth());

        newPic->StretchBlt(virtual_screen,
            RectWH(0, 0, virtual_screen->GetWidth(), virtual_screen->GetHeight()),
            RectWH(0, 0, width, height));
    }

    // replace the bitmap in the sprite set
    add_dynamic_sprite(gotSlot, gfxDriver->ConvertBitmapToSupportedColourDepth(newPic));
    ScriptDynamicSprite *new_spr = new ScriptDynamicSprite(gotSlot);
    GlobalReturnValue.SetDynamicObject(new_spr, new_spr);
    return new_spr;
}
开发者ID:Cheeseness,项目名称:ags,代码行数:54,代码来源:dynamicsprite.cpp

示例14: DynamicSprite_GetDrawingSurface

ScriptDrawingSurface* DynamicSprite_GetDrawingSurface(ScriptDynamicSprite *dss)
{
    ScriptDrawingSurface *surface = new ScriptDrawingSurface();
    surface->dynamicSpriteNumber = dss->slot;

    if ((game.spriteflags[dss->slot] & SPF_ALPHACHANNEL) != 0)
        surface->hasAlphaChannel = true;

    ccRegisterManagedObject(surface, surface);
    GlobalReturnValue.SetDynamicObject(surface, surface);
    return surface;
}
开发者ID:Cheeseness,项目名称:ags,代码行数:12,代码来源:dynamicsprite.cpp

示例15: GetGUIAt

GUIObject *GetGUIControlAtLocation(int xx, int yy) {
    int guinum = GetGUIAt(xx, yy);
    if (guinum == -1)
        return NULL;

    multiply_up_coordinates(&xx, &yy);

    int oldmousex = mousex, oldmousey = mousey;
    mousex = xx - guis[guinum].x;
    mousey = yy - guis[guinum].y;
    int toret = guis[guinum].find_object_under_mouse(0, false);
    mousex = oldmousex;
    mousey = oldmousey;
    if (toret < 0)
        return NULL;

    GlobalReturnValue.SetDynamicObject(guis[guinum].objs[toret], &ccDynamicGUIObject);
    return guis[guinum].objs[toret];
}
开发者ID:Cheeseness,项目名称:ags,代码行数:19,代码来源:guicontrol.cpp


注:本文中的RuntimeScriptValue类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。