#1
|
|||
|
|||
TexQuad FadeOut/FadeIn issue
Hi,
I'm experiencing some kind of a problem, when using fadein/fadeout on viz.SCREEN. Despite the code I use there's no fadeOut. The image justa appears after 1 sec. The code I use is: Code:
def drawTrainingList(self,prod_list): products_per_column = 8 image_y_position = 0.75225 image_x_position = 0.125 background_x_inc = 0.125 image_y_pos_inc = 0.097 image_x_pos_inc = 0.3335 number_x_pos_inc = 0.07 number_y_pos_inc = 0.05 text_x_pos_inc = 0.01 text_y_pos_inc = 0.05 if len(prod_list) < 9: image_x_position += image_x_pos_inc elif len(prod_list) > 8 and len(prod_list) < 17: image_x_position += image_x_pos_inc/2 product_index = 0 self.background_texture_list = [] self.product_texture_list = [] self.product_text_list = [] self.seq_numbers_list = [] fadeOut = vizact.sequence( vizact.method.visible(1), vizact.fadeTo(1.0,speed=1.0) ) self.background_wallpaper = viz.addTexQuad(viz.SCREEN,align=viz.TEXT_LEFT_BOTTOM,pos=(0,-0.1,0),scale=(12.8,11.725,1)) self.background_wallpaper_texture = viz.add(config.SCREEN_PATH + 'background.png') self.background_wallpaper.texture(self.background_wallpaper_texture) self.title_text = viz.addText('Ingredients', parent = viz.SCREEN,align=viz.TEXT_CENTER_CENTER,pos=(0.5,0.92,0),scale=(0.85,1,1)) while product_index < len(prod_list): if product_index % products_per_column == 0 and product_index != 0: image_x_position += image_x_pos_inc image_y_position = 0.75225 self.background_texture_list.append(viz.addTexQuad(viz.SCREEN,align=viz.TEXT_LEFT_BOTTOM,pos=(image_x_position-background_x_inc,image_y_position,0))) self.background_texture_list[product_index].texture(prod_list[product_index].background) self.background_texture_list[product_index].setScale(4.275,1.0) self.background_texture_list[product_index].alpha(0) self.background_texture_list[product_index].visible(0) self.product_texture_list.append(viz.addTexQuad(viz.SCREEN,align=viz.TEXT_RIGHT_BOTTOM,pos=(image_x_position,image_y_position,0))) self.product_texture_list[product_index].texture(prod_list[product_index].texture) self.product_texture_list[product_index].setScale(0.775,1.0) self.product_texture_list[product_index].alpha(0) self.product_texture_list[product_index].visible(0) self.product_text_list.append(viz.addText(prod_list[product_index].name,viz.SCREEN,align=viz.TEXT_LEFT_CENTER,pos=(image_x_position+text_x_pos_inc,image_y_position+text_y_pos_inc,0),scale=[0.35,0.4,0.4])) self.product_text_list[product_index].alpha(0) self.product_text_list[product_index].visible(0) self.seq_numbers_list.append(viz.addText(str(product_index+1)+'.',viz.SCREEN,align=viz.TEXT_RIGHT_CENTER,pos=(image_x_position-number_x_pos_inc,image_y_position+number_y_pos_inc,0))) self.seq_numbers_list[product_index].alpha(0) self.seq_numbers_list[product_index].visible(0) self.seq_numbers_list[product_index].setScale(0.3,0.4) self.background_texture_list[product_index].runAction(fadeOut) self.product_texture_list[product_index].runAction(fadeOut) self.product_text_list[product_index].runAction(fadeOut) self.seq_numbers_list[product_index].runAction(fadeOut) image_y_position -= image_y_pos_inc product_index += 1 yield viz.waittime(config.DRAW_LIST_ELEMENT_INTERVAL) I've arealdy tried something like this to 3d models and everything runs smoothly. Best regars, Alex. |
#2
|
|||
|
|||
What is the value of the config.DRAW_LIST_ELEMENT_INTERVAL variable? You are passing this value to viz.waittime, which will block rendering for the specified amount of seconds. If the value of the variable is around 1 second, then you are stalling the frame for a second and it when it continues, the fade action will be complete.
I noticed you are yielding the value of viz.waittime. Were you intending to use viztask.waitTime instead? |
#3
|
|||
|
|||
You're totaly right i wanted to use viztask instead, my bad. Thanks!
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using a texquad to cover a window | Enlil | Vizard | 4 | 02-07-2012 03:13 PM |
Multiple Textures for Diffuse and Specularity Shader Issue | shivanangel | Vizard | 1 | 05-11-2009 10:44 AM |
Cal3D texture issue from Max | shivanangel | Vizard | 5 | 10-17-2008 12:17 PM |
vizard 2.5 compatability issue | shai | Vizard | 3 | 08-10-2005 04:35 PM |
texquad | shai | Vizard | 1 | 02-23-2005 01:09 PM |