Victory Chart with Brush Container inside a horizontal scrollview causes crash when both horizontal movements are activated - react-native

When a horizontal scrollview contains a VictoryChart with a brushContainer, if you activate the brush container and the horizontal scrollview at the same time it causes a crash with
ERROR TypeError: svg.getScreenCTM is not a function. (In 'svg.getScreenCTM()', 'svg.getScreenCTM' is undefined)
This case can be produced easily by using a fast single finger movement swiping horizontally over the chart

Related

How to use an horizontal scrollView while using createMaterialTopTabNavigator with swiping enabled, REACT NATIVE

i'm using createMaterialTopTabNavigator with a swipeEnabled set to True to navigate between screens, I have a Screen which contains an horizontal scrollView, the problems is that the scrollView isn't working, since whenever i try to scroll it horizontally the screen just changes to the next one.
I'd like to be able to disable the swipeEnabled when i swipe in the scrollView.
PS: i tried doing it dynamically by passing a variable to the Screen and a method that sets it to false using onTouchStart, but it's slower than the swiping event of the screen so it end up swiping to the next screen before onTouchStart event start.

Problem with cutting sprites from a surface

I want to create a lighting effect for my game. I did some research and I could do that by drawing a semi-transparent square and cutting out a circle or custom sprite. I looked through this tutorial here -> https://www.yoyogames.com/blog/476/quick-and-simple-lighting
My code runs, but it only shows the black screen and doesn't cut out the sprite from it. Is there something I am missing
CREATE EVENT
////////////
surface=-1;
DRAW EVENT
//////////
colortemp=draw_get_color();
cw=camera_get_view_width(view_camera[0]);
ch=camera_get_view_height(view_camera[0]);
cx=camera_get_view_x(view_camera[0]);
cy=camera_get_view_y(view_camera[0]);
if(!surface_exists(surface)){
surface=surface_create(cw,ch);
surface_set_target(surface);
draw_set_color(c_black);
draw_set_alpha(0);
draw_rectangle(0,0,cw,ch,false);
surface_reset_target();
}
if(surface_exists(surface)){
surface_set_target(surface);
//Draws the rectangle
draw_set_color(c_black);
draw_set_alpha(0.8);
draw_rectangle(0,0,cw,ch,-1);
//Draws the sprite
gpu_set_blendmode(bm_subtract);
draw_set_color(c_white);
draw_set_alpha(1);
draw_sprite_ext(light_source,0,(player.x+player.sprite_width/2),(player.y+player.sprite_height/2),1,1,0,c_white,1);
//Resets variables
gpu_set_blendmode(bm_normal);
draw_set_color(colortemp);
draw_set_alpha(1);
//resets target
surface_reset_target();
//Draws surface
draw_surface(surface,cx,cy);
//frees the screen to prevent memory leaks
if surface_exists(surface){
surface_free(surface);
}
}

anchoring an image at the bottom of the content area of a flatList in react native

For an app i'm working on the designer wants a background image to a scrollview which would be anchored to the bottom of the content area of the scrollview.
So let's say the screen is 500px tall,the scrollview on content is 1000px, the image to display in the background is 200px.
How can i make it so that the background of the flatlist is empty until the user scroll and reveals the bottom 200px of the content of the scrollview.

Immutable view inside zoomable scrollview [react-native]

i'd like to know if it's possible to put a View inside a zoomable ScrollView but when the user zooms the scrollview, the view's size wont change. The view must be inside the scrollview because the image on the scrollview is bigger than the screen and i`ll render the view overlaying the image in a precise x:y position.
thanks
kinda extreme go horse but if you put the prop onScroll inside scrolView you can get the zoom and divide the width/height of the view by the zoomScale
onScroll={(event) => this.setState({ zoomScale:event.nativeEvent.zoomScale})}

How to get rounded Corner button image in QML after tiling

I have Button image with Rounded Button image. I am tiling image to get bigger button in QML . I am using parent as rectangle and image as BorderImage. After tiling I am getting rectangle on top image is visible. I need to remove the part of the rectangle so that only rounded button image (Has transparency) is Visible. Even i need to change the color of the behind rectangle so that Color animation is possible.
Please suggest efficient method to remove the behind rectangle and provide the color animation also.
I am attaching the Rounded button border image as attachment and source code for tiling the button image.
Rectangle{
id:outerBorderRect
smooth:true
anchors.fill:parent
//opacity:.25
//border.width:0
BorderImage{
id:innerBorderRect
smooth:true
anchors.fill:parent
border{left:20;top:16;right:17;bottom:20}
horizontalTileMode:BorderImage.Round
verticalTileMode:BorderImage.Round
source:"button_3.png"
}
}
A simple and semi-hack way to do this is to use the radius property in Rectangle to hide the corners of your button.
Or you could use a proper mask by using Qt's OpacityMask.
I'm not sure what kind of animation you're looking for. You'll have to provide more details for me to answer that part.