Re: [Pipmak-Users] Pipmak development
Status: Alpha
Brought to you by:
cwalther
From: Andrea V. <and...@gm...> - 2007-07-10 09:44:28
|
Fabrizio Pistonesi <fpistonesi <at> libero.it> writes: > > Hello, > sorry, (I remind I am NOT a programmer ^_^) > Don't to be too much severe with yourself... at least you are an lua programmer... ;) The repeated use of setfullscreen({smaller}) does not guarantee you to obtain the same screen resolution on different hardware (some graphic card could skip certain resolution) With my proposal you could direct switch to a particular screen resolution, and before (with getscreenmodes) you could check if it is supported by the hardware. > For the second point I hope you haven't based your work on the old mine :D So you have write the article in the wiki... I checked and it seems good. I tryed also and It work fine. I don't think there are some contraindications. > ________________________________________________________ > > <A Lua function to smoothly pan to a specific direction in a panorama.> > > -get the difference of the coords of the current viewdirection with the target view direction > -divide this value in an arbitrary number (60) > -for each x millisecons (pipmak.schedule) and increase/decrease the coords of the current view > what params would we use? > az,el: coord > time: the time the animation last > div(2 to 360): greater is this number smoother is the animation > clockwise (true/false): for value between 181 and 359 we can set clockwise=false Did you have tried some lua code to do that? (You still thought to not to be a programmer? :) ) I will try to implements... > ________________________________________________________ > > This is not important but easy and useful for newbe: > There is a plugin for Gimp for extract and save all frames from a video as mymovie_0000; mymovie_0001 etc > with a schedule we can play it on a patch > we can use a function playmovie() or an object like "sound" > > local intro movie {"../movie/intro/intro_", framenumber=100,[framerate=60]} > intro:play() > > What do you think? I hope is not stupid... > I think video patches needs a more exhaustive analysis, but I don't think that your idea was stupid, it could be an initial workaround to satisfy the lack of video patches, I'm thinking to publish on wiki some "libraries" that add some lua objects to simplify from the programmer point of view some things, adding functions that aren't directly implemented by pipmak. I have thought to these: color.lua to get better management of colors dialog.lua to use some simple dialog box (text,button,check box and so on) animation.lua to simplify animation (and we could put here your idea) inventory.lua to manage inventory list others? all of them will be included with pipmak.dofile("lib/<library_name>.lua") in main.lua All of this libraries use actual pipmak function as elementary bricks and with the development of Pipmak some library functions could move directly in the Pipmak code... I have already prepared "color.lua" for my autocubic project (which I would that it was a library too) with these methods: -- c=newcolor(string) htmlcolor|{dark|light}colorname -- accept "FF8092" like HTML or colorname -- red,blue,yellow,darkred,lightyellow,... -- c:setcolor(string) htmlcolor|{dark|light}colorname -- c:getRGBA() return r,g,b,a -- c:invert() invert color -- c:brithness(br) br=1:white br=-1:black -- c:alpha(a) set alpha -- c:Red(r) set red -- c:Green(g) set green -- c:Blue(b) set blue -- c:tostring() return string rappresentation Example of use: c1=newcolor("red") -- use colornames c2=newcolor("00FF00") -- use color strings as HTML code patch1:setcolor(c1:getRGBA()) -- set patch color c1:brithness(0.5):Red(0.2) -- make color lighter and -- increments red component img:color(c2:getRGBA()):fill() -- fill img using c2 color -- (needs pipmak build 155) "dialog.lua" is still in development (it needs pipmak build 155 to work): Here an example of use: d1=newdialog{x=70,y=70,h=300,w=300, title="Title of the dialog", title_bgcolor=c1, title_fgcolor=c3} d1:setfont{size=20} d1:text{"Welcome",align=pipmak.center} d1:text{} --leave a empty line d1:setfont{} --return to standard font d1:text{"This is a preliminary dialog object.\nBye"} d1:show() --show dialog window I NEED remarks to known if this idea of libraries is good or not. Or if better implements all in pipmak code. Fabrizio, Christian and all other pipmakers, what do you thinking about? Andrea |