CHDK Scripting Cross Reference Page - page 2 - Script Writing - CHDK Forum

CHDK Scripting Cross Reference Page

  • 16 Replies
  • 17404 Views
*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: CHDK Scripting Cross Reference Page
« Reply #10 on: 18 / May / 2012, 05:46:37 »
Advertisements
It's something from the old ptp liveview code, it will go away.

This is not so good. Since we have cameras with different screen width and lua drawing & console comands it would be useful to have a command for determination of screen width.

msl
CHDK-DE:  CHDK-DE links

Re: CHDK Scripting Cross Reference Page
« Reply #11 on: 18 / May / 2012, 16:22:20 »
Textbox added.

[offtopic]

When I was writing the lua drawings I tried to provide such lua commands like draw_get_width() and draw_get_height() but I had no idea how to do so. It would be very nice.

AFAIR I tried to just return the values of camera_screen.width and camera_screen.height (as in gui_draw.c) but they gave strange values. Now I can't recall what it was.

The idea was:

Code: (c) [Select]
static int luaCB_draw_get_width( lua_State* L )
{
  lua_pushnumber( L, camera_screen.width );
  return 1;
}

static int luaCB_draw_get_height( lua_State* L )
{
  lua_pushnumber( L, camera_screen.height );
  return 1;
}


With such functions there could be constant values defined in drawings.lua modules for convenient usage:

Code: (lua) [Select]
WIDTH=draw_get_width()
HEIGHT=draw_get_height()

[/offtopic]
« Last Edit: 18 / May / 2012, 16:39:34 by outslider »
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

*

Offline reyalp

  • ******
  • 14082
Re: CHDK Scripting Cross Reference Page
« Reply #12 on: 19 / May / 2012, 00:17:45 »
It's something from the old ptp liveview code, it will go away.

This is not so good. Since we have cameras with different screen width and lua drawing & console comands it would be useful to have a command for determination of screen width.
msl
That's fine, but it should not be this function, because what it returns is not very useful for lua.

Maybe a moderator can split this discussion ?
Don't forget what the H stands for.

Re: CHDK Scripting Cross Reference Page
« Reply #13 on: 19 / May / 2012, 00:49:49 »
That's fine, but it should not be this function, because what it returns is not very useful for lua.
Maybe a moderator can split this discussion ?
Or to make things easy - just start another thread on "Scripting function to report display sizes" ?
Ported :   A1200    SD940   G10    Powershot N    G16


Re: CHDK Scripting Cross Reference Page
« Reply #14 on: 20 / May / 2012, 13:18:37 »
That's fine, but it should not be this function, because what it returns is not very useful for lua.
Maybe a moderator can split this discussion ?
Or to make things easy - just start another thread on "Scripting function to report display sizes" ?

Done:

http://chdk.setepontos.com/index.php?topic=8138.new#new
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

Select/case?
« Reply #15 on: 29 / May / 2012, 09:49:29 »
Skywalker9's Selective Intervalometer script uses select/case/end_select, but I can't find that in the cross reference or any other documentation.  Am I missing something?
S3 IS with LensMate filter/hood adapter

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: CHDK Scripting Cross Reference Page
« Reply #16 on: 29 / May / 2012, 11:17:19 »
... uses select/case/end_select, but I can't find that in the cross reference or any other documentation.

http://images2.wikia.nocookie.net/__cb20100806022158/chdk/images/e/e5/UBASIC_User_Guide_D0_5.pdf

Page 19
CHDK-DE:  CHDK-DE links

 

Related Topics